You are here:
» Hashmap Java Example?
Hashmap Java Example?
This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.
can someone provide me with some nice and quick example of hashmap in java?

1 year 43 weeks ago
Tags:
Map is an object that stores key/volume pairs. Given a key, you can find its value. Keys must be unique, but values may be duplicated. The HashMap class provides the primary implementation of the map interface. The HashMap class uses a hash table to implementation of the map interface. This allows the execution time of basic operations, such as get() and put() to be constant.
This code shows the use of HaspMap. In this program HashMap maps the names to account balances.
Output Screen:
Tony
while using hashmap its important to consider rehashing. because when hashmap reached its threshold specified by its load-factor and capacity it creates another Map and rehash all bucket location which could potentially slowdown insertion in map , see How HashMap works in Java for more details
Post Comment