I have a question. In a switch statement, is default
tested for last even if it isn't last?
If so, in the following code snippet:
int i = 6;
int a=0, b=0, c=0;
switch (i)
{
case 1:
a++;
case 2:
default:
case 3:
b++;
case 6:
c++;
}
System.out.println(a + " " + b + " " + c);
After matching with case 6, and incrementing the value of c, since there is no break, will it go back to default?
I did try this code and it didn't seemly go to default and a fall-through did not occur. I just wanted to know?