/**
* 〈一句话功能简述〉<br>
* 〈switch and case〉
*
* @author abu
* @create 2019/7/5
* @since 1.0.0
*/
public class TestSwitch {
public static void main(String[] args){
/*简单的switch case break,
变量可以是char,byte,short,int,枚举,String;
default可选,放哪里都行;
case的条件只能是值,不能是取值范围;
*/
//test1基础输出
/*
int i = 90;
switch(i){
case 0:
System.out.println("是0呀");
break;
case 1:
System.out.println("是1呀");
break;
case 2:
System.out.println("是2呀");
break;
case 3:
System.out.println("是3呀");
break;
default:
System.out.println("谁知道你是谁");
break;
}
*/
//test2 判断输出
/*
System.out
07-17
07-17
07-17
07-17
07-17
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交