Java Enumeration
Q1.
What is the implicit superclass of all enums in Java ?
Q2.
What is the default base class of all enums in Java?
Q3.
Which of the following is NOT true about enums in Java?
Q4.
What will be the output of the following code?
enum Day { MONDAY, TUESDAY, WEDNESDAY }
public class Test {
public static void main(String[] args) {
Day d = Day.MONDAY;
System.out.println(d);
}
}
Q5.
Which method returns all constants of an enum type in Java?