0
What means this in java please " += "
2 Respuestas
+ 6
This is an assignment addition operator. This operator is used when the variable in the left side of the assignment operator is same as the variable present on the right side..
In simple words if we need to change the same variable in which we have to assign the result then this shortened operator is used.
For example:
a = a+6;
Variable a gets the value after adding 6 in variable a itself.
So it can be written as
a += 6 which means a is assigned after adding the 6 in a .
In the same manner There are other assignment operator also used like :
*=, -=, /= , %= .
+ 1
Thank you