publicclass A3 {publicstaticvoidmain(String[] args){String flag ="绿灯";/*switch (flag){
case "红灯":
System.out.println("红灯停!");
break;
case "绿灯":
System.out.println("绿灯行!");
break;
case "黄灯":
System.out.println("黄灯等一等!");
break;
default:
System.out.println("你去死吧!!!");
break;
}*/switch(flag){case"红灯":System.out.println("红灯停!");// break;case"绿灯":System.out.println("绿灯行!");//break;case"黄灯":System.out.println("黄灯等一等!");break;default:System.out.println("你去死吧!!!");//break;}int i =1;switch(i){case1:System.out.println("1");break;case10:System.out.println("10");break;case100:System.out.println("100");break;}char ch ='b';switch(ch){default:System.out.println("不知道!!!");break;case'a':System.out.println("元音");break;}boolean b =false;//需求 : 通过switch语句对boolean类型变量进行判断switch(b+""){case"true":System.out.println("true");break;case"false":System.out.println("false");break;}int in = b?1:0;switch(in){case0:System.out.println("00000");break;case1:System.out.println("11111111");break;}}}