版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangjun5159/article/details/84333436
源码
public enum EnumTest {
ONE,
TWO,
THREE,
;
}
jad -o EnumTest.class
生成EnumTest.jad
反编译后
public final class EnumTest extends Enum
{
public static EnumTest[] values()
{
return (EnumTest[])$VALUES.clone();
}
public static EnumTest valueOf(String name)
{
return (EnumTest)Enum.valueOf(com/bwatson/service/EnumTest, name);
}
private EnumTest(String s, int i)
{
super(s, i);
}
public static final EnumTest ONE;
public static final EnumTest TWO;
public static final EnumTest THREE;
private static final EnumTest $VALUES[];
static
{
ONE = new EnumTest("ONE", 0);
TWO = new EnumTest("TWO", 1);
THREE = new EnumTest("THREE", 2);
$VALUES = (new EnumTest[] {
ONE, TWO, THREE
});
}
}
编译器会创建一个有参构造并且是private