Sail E0 Webinar
Question
What all gets printed when the following program is compiled and run.public class Test{ public static void main(String args[]){ int i, j=1; i = (j>1)?2:1; switch(i){ case 0: System.out.println(0); break; case 1: System.out.println(1); case 2: System.out.println(2); break; case 3: System.out.println(3); break; } }}
Options:
A .  2
B .  1 2
C .  0
D .  3
E .  1
Answer: Option B

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers