posted 18 years ago
switch (2) {
case 1:
System.out.println(1);
case 2: // inside here, no break
case 3: // fall throught here, no break
System.out.println(3);
case 4: // fall throught here, no break
System.out.println(4);
}
Because the code will go inside case 2 then fall through to case 3, case 4 because they dont have break statement.
Ricky