I have a test class with an internal enum and an EnumMap like the following. How do I find out which enum is used within the EnumMap?
enum MyEnum { ENUM1, ENUM2 }
EnumMap<MyEnum, String> emap = new EnumMap<>( MyEnum.class );
public void discover() {
Class<?> eclass = ???;
System.out.println( eclass );
}
should print
MyEnum.class
Aucun commentaire:
Enregistrer un commentaire