KnowledgeBoat Logo

Computer Applications

Explain the shorthand assignment operator with an example.

Java Operators

46 Likes

Answer

Java provides shorthand assignment operators for all the arithmetic binary operators. Shorthand assignment operators follow the below syntax:

variable = variable operation expression;

Taking the example of shorthand addition operator, the expression x = x + 3 can be rewritten as x += 3;

Answered By

30 Likes


Related Questions