标签:style color ar for on c ef as r
enum ColorE {
RED, GREEN, BLUE;
}
public class GetEnumContent {
public static void main(String[] args) {
// ColorE color=ColorE.BLUE;
// System.out.println(color);
// for (ColorE c : ColorE.values()) {
// System.out.println(c);
// }
for(ColorE c:ColorE.values()){
print(c);
}
}
public static void print(ColorE color) {
switch (color) {
case RED: {
System.out.println("I AM RRRRRRRRRED.");
break;
}
case GREEN: {
System.out.println("I AM GRREN.");
break;
}
case BLUE: {
System.out.println("I AM BLLLUUUE.");
break;
}
default: {
System.out.println("I DONT KOWN THIS COLOR.");
break;
}
}
}
}
标签:style color ar for on c ef as r
原文地址:http://www.cnblogs.com/vonk/p/3953137.html