2011年12月27日

switch---case中的中断和直落

摘要: 用了那么久switch-case到现在才知道有直落这么回事,看下面例子: public static void main(String[] args){ int i = 3; switch(i){ case 3: System.out.println("第一个CASE"); //这里没有用break中断,所以满足条件后就直落下个CASE case 2: System.out.println("第二个CASE"); break;//这里使用了break中断,所以没有执行下个CASE块 case 4: System.out.pri... 阅读全文

posted @ 2011-12-27 08:46 东方泛起鱼肚白 阅读(538) 评论(0) 推荐(0) 编辑

导航