java之switch

package switchleaning;

public class TestSwitch {
    public static void main(String[] args) {
        int i = 1;
        switch (i) {
        case 1:
        case 2:
        case 3:
        case 4:
            System.out.println(4);
        case 5:
            System.out.println(5);
        }
    }
}

实验结果:

4
5
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页