62,625
社区成员
发帖
与我相关
我的任务
分享
public class S_Enum2 {
enum Color{
RED,GREEN,BLUE;
}
public static void main(String[] args){
for(Color val:Color.values()){
System.out.println("枚举的类型:"+val);
}
}
}
枚举的类型:RED
枚举的类型:GREEN
枚举的类型:BLUE
Process finished with exit code 0