Which statement about the following program is true?
public enum Main { GOOD('C'), BETTER('B'), BEST('A'); private char v; Main(char v) {//from w w w . jav a 2 s. co m this.v = v; } abstract public char getGrade(); public static void main (String[] args) { System.out.println (GOOD.getGrade()); // (1) } }
Select the one correct answer.
getGrade()
in (1) can be written without the enum type name.(d)
An enum type cannot be declared as abstract.
(b) is not correct, because without the enum type name, it would be a call to an instance method in a static context.
Any abstract method must be implemented by each enum constant.