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