Why Java does not allow overriding equals(Object) in an Enum?
- by Ashwin Prabhu
@Override
public boolean equals( Object otherObject )
is not allowed in Java for an Enum, since the method equals(Object x) is defined as final in Enum. Why is this so?
I cannot thing of any use case which would require overriding equals(Object) for Enum. I'm just curious to know the reasoning behind this behavior.