Given the code fragment:
What is the result if the integer aVar is 9?
A. 10 Hello World!
B. Hello Universe!
C. Hello World
D. Compilation fails.
Given the code fragment:
What is the result if the integer aVar is 9?
A. 10 Hello World!
B. Hello Universe!
C. Hello World
D. Compilation fails.
A
A :
# javac Test1.java
# java Test1
10 Hello world!
Obviously in IF statement it firstly evaluates that 9 < 10 then increases aVar++ and proceeds to aVar + "Hello world!