Other |
---|
5.0 b46Fixed |
Relates :
|
|
Relates :
|
|
Relates :
|
the following program should print "false", as the classof a is an anonymous class that was not declared as an enumeration type. The proper implementation of isEnum should check both the ACC_ENUM bit on the class AND that the direct supertype is java.lang.Enum. Only when both conditions are true should the method return true. enum E { a {}; public static void main(String[] args) { System.out.println(a.getClass().isEnum()); } }
|