What is the result of the following code? (Choose all that apply.)
public class Swimmer { enum Letter { A, B { //from w ww . ja v a2s .c o m public boolean hasFins() { return true; }}, C, D, E, F; public abstract boolean hasFins(); } public static void main(String[] args) { System.out.println(Letter.B); System.out.println(Letter.B.ordinal()); System.out.println(Letter.B.hasFins()); System.out.println(Letter.C.hasFins()); } }
G.
This question appears to be about enums but is really about abstract methods.
Just as an abstract superclass requires concrete subclasses to have an implementation, abstract enum methods require each enum type to implement the method.