title: Override equals and hashCode methods in superclass or in the sub class or override in both
body: <p>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. </p>
  
  <p>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? </p>
  
  <p>My subclass has no instance variables and my superclass has 2 instance variables (integers)</p>
  
  <p>My subclass constructor is calling the superclass constructor.</p>
  
  <p>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?</p>