I am relatively new to java programming and have had a problem finding out where to use equals and hashcode method overriding when I have a subclass inheriting from the superclass.
I want to check for equality for objects of the superclass and subclass and was wanting to know if either or both the superclass and subclass would need their equals and hashcode methods overriding?
My subclass has no instance variables and my superclass has 2 instance variables (integers)
My subclass constructor is calling the superclass constructor.
If I want to override the subclass equals and hashcode methods is that possible based on the fact the subclass has no instance variables but inherits the 2 instance variables from its superclass?