Java - What is the output: enum value and equals() method

Question

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));

  }
}


Click to view the answer

true
false
false

Note

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.