Given: What is the result?
A.
Hello
B.
Default
C.
Compilation fails
D.
The program prints nothing
E.
An exception is thrown at run time
Given: What is the result?
A.
Hello
B.
Default
C.
Compilation fails
D.
The program prints nothing
E.
An exception is thrown at run time
Answer is correct, tried it in eclipse
A
Answer: A
Explanation:
class X | String str | print() | Result
new X(“Hello”) | “Hello” | System.out.println(str) | Prints out Hello