Frage im Vorstellungsgespräch bei KinderTouch

Which two methods you need to implement for key Object in HashMap?

Antwort im Vorstellungsgespräch

Anonym

18. Mai 2017

In order to use any object as Key in HashMap, it must implement equals and hashcode method in Java. Read How HashMap works in Java for a detailed explanation on how equals and hashcode method is used to put and get an object from HashMap.