what is hashCode() method in java?

hashCode():

  • for  every object jvm  will assign one unique id which is nothing but hashCode.
  • Jvm uses hashCode will saving objects into hashtable or hashmap or hashset.
  • We can generate hashcode by overriding hashCode() method in class.

No comments:

Post a Comment