public enum Style {
BIG,MEDIUM,SMALL;
public static void main(String[] args) {
System.out.println(Style.SMALL.toString() == "SMALL");
}
}
Why does this work? I expect the print to be false, since ==
compares the object references. However, it prints true
.
I would appreciate if someone can explain the underlying behaviour.