One more small query.I executed the below:
Code: Select all
LOOP: for (i = 0; i <= 5; i++) {
switch (i = 6) {
case '0':
System.out.println("A");
case 1:
System.out.println("B");
break LOOP;
case 2:
System.out.println("C");
break;
case 3:
System.out.println("D");
break;
case 4:
System.out.println("E");
case 'E':
System.out.println("F");
}
}
If the variables in switch statements are compile time constants then i would assume that i=6 is also being assigned at compile time as it is assigned to a fixed value. Please help.