is it compulsary to override equals and hashCode methods for classes which are defined as final?
Define a class as final
and overriding equals()
and hashCode()
are two different things.
Final is there to restrict a class not to be sub classed. And, equals()
is there to check the equality of the instances of a class.