public class MainClass { public static void main(String[] argv) { if (MyEnum.X == MyEnum.Y) { System.out.println("Equals"); } MyEnum x = MyEnum.X; MyEnum y = MyEnum.Y; if (x == y) { System.out.println("Equals"); }else{ System.out.println("Not Equals"); } } } enum MyEnum { X, Y; }