这代码排版怎么这么糟糕
重发
public class EnumTest {
public static void main(String[] args) {
for (Color c : Color.values()) {
System.out.println("c:" + c);
System.out.println("c.name():" + c.name());
System.out.println("c.ordinal():" + c.ordinal());
System.out.println("c.getColorName()" + c.getColorName());
System.out.println("---------------------------------------");
}
}
}
enum Color {
RED {
public String getColorName() {
return "红色";
}
},
GREEN {
public String getColorName() {
return "红色";
}
},
BLUE {
public String getColorName() {
return "红色";
}
};
public abstract String getColorName();
} |