Answer the question
In order to leave comments, you need to log in
How to correctly generate keys for HashMap and what type?
Is there any generally accepted way to generate keys and what should they be? While generating integer keys, the next key is an increment of the previous one. I look forward to links to resources, reasonable answers.
Answer the question
In order to leave comments, you need to log in
The key in a HashMap can be anything (even NULL ) The HashMap uses the result of the Object.hashCode() method as a key . On this occasion, Bloch is very well written, read
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question