好像没啥意义.nilou{one,two,three,four}enum nilou{one,two,three,four}public class lianxi6{\x05\x05public static void main (String asgr[])\x05{\x05\x05switch (nilou.three)\x05{\x05case two:\x05{\x05System.out.println("扯蛋");\x05\x05break;\x05\

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 04:26:15

好像没啥意义.nilou{one,two,three,four}enum nilou{one,two,three,four}public class lianxi6{\x05\x05public static void main (String asgr[])\x05{\x05\x05switch (nilou.three)\x05{\x05case two:\x05{\x05System.out.println("扯蛋");\x05\x05break;\x05\
好像没啥意义.nilou{one,two,three,four}
enum nilou{one,two,three,four}
public class lianxi6
{
\x05
\x05public static void main (String asgr[])
\x05{
\x05
\x05switch (nilou.three)
\x05{
\x05case two:
\x05{
\x05System.out.println("扯蛋");
\x05
\x05break;
\x05
\x05
\x05}
\x05
\x05
\x05case three:
\x05{
\x05System.out.println("还可以");
\x05
\x05
\x05break;
\x05
\x05}
\x05
\x05default:
\x05\x05System.out.println("潘孝斌");
\x05
\x05
\x05
\x05
\x05}
\x05\x05
\x05
\x05\x05\x05\x05\x05\x05\x05
\x05
\x05
}
\x05
\x05
\x05
\x05
\x05
}

好像没啥意义.nilou{one,two,three,four}enum nilou{one,two,three,four}public class lianxi6{\x05\x05public static void main (String asgr[])\x05{\x05\x05switch (nilou.three)\x05{\x05case two:\x05{\x05System.out.println("扯蛋");\x05\x05break;\x05\
enum nilou{one,two,three,four}
这是一个枚举
你可以把他看做一个对象,这个对象里只能是 one,two,three,four 范围内的
就好比,性别 sex只能是 男或者女
而下面的方法就是标准的 switch case
相当于 if else
如果 One 那么.
two 那么.
.就是判断,然后根据枚举的这个值去找到相应的判断