DEV Community

Cover image for What does %= mean in Java?
Lalit Kumar
Lalit Kumar

Posted on

What does %= mean in Java?

In this article, a detailed explanation of assignment operators and its uses is observed which in particular will be the Modulus AND assignment operator ( %= ).

Assignment Operators

You know different operators are supported by the Java language and one of its kind is the assignment operator. These assignment operators are basically divided into eleven types and are shown below

  1. Simple assignment operator “ = “

  2. Add AND assignment operator “ += “

  3. Subtract AND assignment operator “ -= “

  4. Multiply AND assignment operator “ *= “

  5. Divide AND assignment operator “/=”

  6. Modulus AND assignment operator “%=”

  7. Left Shift AND assignment operator “<<=”

  8. Right Shift AND assignment operator “>.=”

  9. Bitwise AND assignment operator “ &=”

  10. Bitwise exclusive OR and assignment operator “ ^= “

  11. Bitwise inclusive OR and assignment operator “!=”

Approach

The modulus AND operator (%=) will perform modulus operation of the two operands and the obtained result is allocated to the left operand of the statement. Read more

Top comments (0)