Multiple Choice Question

Quiz Guidelines



Consider the following lines of code:
   System.out.println(null + true); //1
   System.out.println(true + null); //2
   System.out.println(null + null); //3

Which of the following statements are correct?

Select 1 option

A. None of the 3 lines will compile.
B. All the 3 line will compile and print null true, true null and null null respectively.
C. Line 1 and 2 won't compile but line 3 will print null null.
D. Line 3 won't compile but line 1 and 2 will print null true and true null respectively. 
E. None of the above.

Q&A Set: