@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 think of any use case which would require overriding equals(Object)
for Enum. I'm just curious to know the reasoning behind this behavior.