My Java Quiz

The ultimate place to learn Java!

Question #61: What is the output of below code?


int i, j=1;
i = (j>1)?2:1;
switch(i) {
  case 3: System.out.print(3+","); break;
  case 1: System.out.print(1+",");
  case 2: System.out.print(2+","); break;
}