So i have an abstract class and two classes that e...
# getting-started
j
So i have an abstract class and two classes that extend it. I have two lists of the abstract class. with union function they all seem to be unique even if i override equals function to return true on the absract class and both of the extending classes. Anyone have a clue why is that?
m
are you also overriding
hashCode
?
if not, that’s your problem
if overriding
equals
you should also always override
hashCode
1
j
Completely forgot hashCode, thanks!