Saturday, January 26, 2013

Enums why cant we override equals

in the java.lang.Enum class equals method is like

 
 public final boolean equals(Object other) {
       return this==other;
 }

 
actually overriding it with something else d
oes not make sense hence its final. As for Enums equals() and == are the same things.

No comments: