// Guess the print out, then run it.
// A good IQ test
public class A {
public static void main(String args[]) {
int x = 0;
while (x < 10) {
System.out.print(" " + x);
switch (x) {
case 5: x += 2;
continue;
case 2: break;
case 7: break;
default: x++;
};
x++;
}
}
}
The answer is:^-^
Can we put a continue in a switch-case statement?
最新推荐文章于 2022-06-11 14:21:08 发布