I have searched the web for information, and I got many answers about how enums are implemented. Consider this enum type:
public class Days{
public static final Days MONDAY = new Days();
public static final Days TUESDAY = new Days();
}
Is it true that that is equivalent to this:
public enum Days1{
MONDAY,TUESDAY;
}
?
If I print these in my main method as:
System.out.println(Days.MONDAY);
System.out.println(Days1.MONDAY);
, the two yield different results. Why? How is it that enum constants get printed as they are created, but references to other objects cannot be printed as they are?