Assignment Operators

Assignment operators are used in Java to assign values to variables.

int age;
age = 5;
OperatorExampleEquivalent to
=a = b;a = b;
+=a += b;a = a + b;
-=a -= b;a = a - b;
*=a *= b;a = a * b;
/=a /= b;a = a / b;
%=a %= b;a = a % b;