If a = 12, give the value of the following expression: (a++)--;
Advertisements
प्रश्न
If a = 12, give the value of the following expression:
(a++)--;
लघु उत्तर
Advertisements
उत्तर
Given: a = 12
Expression: (a++)--
The post-increment operator (a++) produces a value, not a variable. The post-decrement operator (--) cannot be applied to this value.
Therefore, the expression causes a compilation error in Java.
- Value of expression ((a++)--) = Compilation error
- New value of a = Not applicable (program does not compile)
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
