请看程序 为什么会报错? package junereflect624; import java.lang.reflect.Constructor; enum Color{ RED,BLUE,GREEN; private Color(){ } } public class EnumDemo8 { public static void main(String[] args) throws Exception { Class<Color> c = Color.class; Constructor<Color> con = c.getDeclaredConstructor();Color co = (Color) con.newInstance(); System.out.println(coSystem.out.println(c.isEnum()); } } |