0
override equals
Is it correct that if i override equals in the subclass i need to use getClass instead of instanceof to keep the symetry? Are there othercases? Should i prefer all the time getClass() != obj.getClass() over this instanceof obj ?
2 Respostas
0
This is difficult to answer without seeing the code, if your just extending a class overriding the method in parent should be fine.
0
@D_Stark
https://code.sololearn.com/ca0a2450a25A/#
on oneside it gives me true but on the other false