title: Relationship between hashCode and equals method in Java
body: <p>I read in many places saying while override <code>equals</code> method in Java, should override <code>hashCode</code> method too, otherwise it is "violating the contract".</p>
  
  <p>But so far I haven't faced any problem if I override only equals method, but not hashCode method.</p>
  
  <p>What is the contract? And why am I not facing any problem when I am violating the contract? In which case will I face a problem if I haven't overridden the hashCode method?</p>