Returns the name of this enum constant, exactly as declared in its enum declaration. Most programmers should use the toString method in preference to this one, as the toString method may return a more user-friendly name. This method is designed primarily for use in specialized situations where correctness depends on getting the exact name, which will not vary from release to release.
Returns: the name of this enum constant
public final String name() {
return name;
}Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero). Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures, such as java. util. EnumSet and java. util. EnumMap.
Returns: the ordinal of this enumeration constant
public final int ordinal() {
return ordinal;
}