I am trying to create enum with few constants. I want the enum to be singleton. With below code, I am getting compilation error in eclipse :
Syntax error, insert ")"
to complete the method declaration at line 5. I am not able to find out whats wrong.
public enum Days {
SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY;
INSTANCE; // line 5
public Days getInstance() {
return INSTANCE;
}
}