Are the auto-increment and auto-decrement operators (++ and –) an essential part of the Java language?
Advertisements
Question
Are the auto-increment and auto-decrement operators (++ and –) an essential part of the Java language?
Short Answer
Advertisements
Solution
No, the auto-increment (++) and auto-decrement (--) operators are not essential parts of the Java language because their operations can also be performed using addition and subtraction.
For example, a++ is equivalent to a = a + 1, and a-- is equivalent to a = a - 1. However, these operators make programs shorter and easier to write.
shaalaa.com
Is there an error in this question or solution?
