I was expecting to see 'default', 100, 200 to be printed in this Class. But default does not print. Why??
New to the group and JAVA. Please comment:
public class SwitchTest {
public static void main(String args[]){
int test = 100;
switch(test){
case 20: System.out.println("20");
default: System.out.println("default");
case 100: System.out.println("100");
case 200: System.out.println("200"); //break;
}
}
}
New to the group and JAVA. Please comment:
public class SwitchTest {
public static void main(String args[]){
int test = 100;
switch(test){
case 20: System.out.println("20");
default: System.out.println("default");
case 100: System.out.println("100");
case 200: System.out.println("200"); //break;
}
}
}