反编译以后能看到: final class color extends Enum { public static color[] values() { return (color[])$VALUES.clone(); } public static color valueOf(String s) { return (color)Enum.valueOf(color, s); } private color(String s, int i) { super(s, i); } public static final color red; public static final color blue; public static final color black; private static final color $VALUES[]; static { red = new color("red", 0); blue = new color("blue", 1); black = new color("black", 2); $VALUES = (new color[] { red, blue, black }); } }
反编译以后能看到:
final class color extends Enum
{ public static color[] values()
{
return (color[])$VALUES.clone();
} public static color valueOf(String s)
{
return (color)Enum.valueOf(color, s);
} private color(String s, int i)
{
super(s, i);
} public static final color red;
public static final color blue;
public static final color black;
private static final color $VALUES[]; static
{
red = new color("red", 0);
blue = new color("blue", 1);
black = new color("black", 2);
$VALUES = (new color[] {
red, blue, black
});
}
}