[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Inheritance - Discussion

Home > JAVA Programming > Inheritance > MCQs Questions Discussion

3 / 9

What all gets printed when the following program is compiled and run.

public class test {
public static void main(String args[]) {
inti, 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;
      }
   }
}

A0

B1

C2

D3

EBoth B & C

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -2 +
    Report


Report Error

Please Login First Click Here