What is the output from the following code
enum Level { LOW, MEDIUM, HIGH, URGENT; } enum Color { RED, GREEN, BLUE; } public class Main { public static void main(String[] args) { Level s1 = Level.LOW; Level s2 = Level.URGENT; Color c = Color.BLUE; System.out.println(s1.equals(s1)); System.out.println(s1.equals(s2)); System.out.println(s1.equals(c)); } }
true false false
The equals() method can be invoked on two enum constants of different types.
If the two enum constants are from different enum types, the method returns false.