This unchecked exception is thrown when Java code attempts to use an enum constant that no longer exists. This can happen only if the enumerated constant was removed from its enumerated type after the referencing code was compiled. The methods of the exception provide the Class of the enumerated type and the name of the nonexistent constant. Figure 10-19. java.lang.EnumConstantNotPresentExceptionpublic class EnumConstantNotPresentException extends RuntimeException { // Public Constructors public EnumConstantNotPresentException (Class<? extends Enum> enumType , String constantName ); // Public Instance Methods public String constantName ( ); public Class<? extends Enum> enumType ( ); } |