When you write an enumeration class, if there are no enumerated values written in the first line of the enumeration class, a compile error occurs: Syntax error on token "String", STRICTFP expected
Like what:
Public enum Season2 implements Timeinfo {
Private final String name; Here is an error: Syntax error on token "String", STRICTFP expected
Private final String desc;
Private Season2 (string name, String desc) {
THIS.name = name;
THIS.DESC = desc;
}
······
}
The reason for the error is that you did not specify what enumeration values you have in the first line, and modify the following:
Public enum Season2 implements Timeinfo {
Spring,summer,fall,winter;//List The enumeration values you want to define, at which time the compilation passes
Private final String name;
Private final String desc;
Private Season2 (string name, String desc) {
THIS.name = name;
THIS.DESC = desc;
}
······
}
Eclipse Enum class Error