Assignment operator is an operator that assigns addition, subtraction and arithmetic operators to a variable. This operator is very often used in the process of making applications, because it is used very well in summarizing code.
Cheat Sheet
= | Assigns a value to a variable |
+= |
Gives a value to a variable by adding the operation to that variable from the contents of the right variable. Example: A = A+B can become A += B |
??= | Assigns a value to a variable when the right-hand variable is null |
-= |
Gives a value to a variable by subtracting the variable from the right side of the variable. Example: A = A-B could become A-=B |
*= |
Gives a value to a variable by multiplying that variable from the contents of the right variable. Example:
A = A*B could be A*=B |
/= |
Gives a value to a variable by dividing the variable from the right side of the variable. Example: A = A/B could be A/=B |
Code Example
Here is a sample code. If it can't be opened please go to here