【发布时间】:2020-04-29 05:39:23
【问题描述】:
public class Ex33 {
public static void main(String[] args) {
int x = 3, result = 4;
switch (x + 3) {
case 6: result = 0;
case 7: result = 1;
default: result += 1;
}
System.out.println(result);
}
}
不明白答案是怎么变成2的?
【问题讨论】:
-
供将来参考:邮政编码,而不是代码图像。不要只说“不明白”,要说你不明白的。你期望它是什么,为什么?
标签: java switch-statement coding-style