Skip to Content
Java Projects - Second Edition
book

Java Projects - Second Edition

by Peter Verhas
August 2018
Intermediate to advanced
524 pages
14h 45m
English
Packt Publishing
Content preview from Java Projects - Second Edition

HashMap

HashMap is a hash table-based implementation of the Map interface. Because the implementation uses a hash table, the get() and put() methods usually perform very fast, constant, and time-independent of the actual number of elements in the map. If the map size grows and the number of table elements is not enough to store the elements ergonomically, putting a new element into this type of map may force the implementation to resize the underlying array. In this case, each element that is already in the array has to be placed again in the new, increased size array. In those cases, the put() operation may consume significant time, proportional to the number of elements in the map.

When an element is to be stored in this map, then hashCode() ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java 11 Cookbook - Second Edition

Java 11 Cookbook - Second Edition

Nick Samoylov, Mohamed Sanaulla

Publisher Resources

ISBN: 9781789131895Supplemental Content