What is the output of the following: int a = 0; int b = 10; a =-b; System.out.println("a:” + a + “b:" +b);
Advertisements
Question
What is the output of the following:
int a = 0;
int b = 10;
a =-b;
System.out.println("a:” + a + “b:" +b);Very Short Answer
Advertisements
Solution
The given code produces a compilation error due to incorrect quotation marks in the System.out.println() statement.
Output: a:-10b:10
shaalaa.com
Is there an error in this question or solution?
