Assignment Operator in Java

In java, assignment operator is used to assign values to variables. Moreover this operator can also be used to assign object references.

Example –

 int count = 1;
 long contactNo = 1233443353;
 String name = "Rutu Shah"
 double average = 77.8;

Also, lets have a look on some more assignment operators of java programming.

OperatorExampleEquivalent to
=x = y;x = y;
+=x += y;x = x+y;
-=x -= yx = x-y;
*=x *= y;x = x*y;
/=x /= y;x = x/y;
%=x %= y;x = x%y;

You can find the code here

Rutu Shah