If a = 12, give the value of the following expression: a − = 10;
Advertisements
Question
If a = 12, give the value of the following expression:
a − = 10;
Short Answer
Advertisements
Solution
Given: a = 12
Expression: a − = 10;
In Java, the subtraction assignment operator must be written as −= without a space between − and =.
Therefore, the given expression causes a compilation error.
- Value of expression (a − = 10) = Compilation error
- New value of a = Not applicable (program does not compile)
shaalaa.com
Is there an error in this question or solution?
