title: Why it is necessary to override hashcode and equals method of key for Hashmap?
body: <p>I created a HashMap having <code>Student</code> as key and String as value.</p>
  
  <p>Now everywhere i have read It is necessary to override <code>equals</code> and <code>hashcode</code> method if using as a key for hashmap.</p>
  
  <p>But I did not override it. And insert multiple key value pairs in hashmap.
  I am also able to fetch it back.</p>
  
  <p>So why it is necessary?</p>