What means this in java please " += " | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What means this in java please " += "

13th Aug 2022, 2:11 PM
wissal boussekine
wissal boussekine - avatar
2 Answers
+ 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 : *=, -=, /= , %= .
13th Aug 2022, 2:18 PM
Pallavi Jha
Pallavi Jha - avatar
+ 1
Thank you
13th Aug 2022, 2:20 PM
wissal boussekine
wissal boussekine - avatar