enum Size{
SMALL,FLOAT;
}
public class Test {
public static strictfp void main(String[] args) throws Exception {
new Test().run(Size.FLOAT);
}
public void run(Size size) {
switch (size) {
case SMALL:
System.out.println("你好");
break;
case FLOAT:
System.out.println("你好,世界!");
break;
default:
break;
}
}
}
最后
以上就是尊敬小懒虫最近收集整理的关于枚举enum在switch中的运用的全部内容,更多相关枚举enum在switch中内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复