Get HashMap keys in sorted order

As we discussed in what is hash map, the entries of the HashMap is not guaranteed to be in any specific order. Hashing algorithm is meant to store it in an efficient way and not in the order. However, at times you come across the situation where you have to list the keys in order.… Continue reading Get HashMap keys in sorted order

How to iterate through a HashMap

Looping through Hash Map is using an iterator. You can get an iterator of Key  Set and loop through it. Provide the correct data type of the entries to make it nice and clean. Here is the example: Iterator<Entry<String,String>> itr= mapObj.entrySet().iterator();//give the right type for key and value here. while (itr.hasNext()) { Map.Entry<String,String> entry =… Continue reading How to iterate through a HashMap

HashMap Helpful Resources on the web

Some of the useful resources I found on web about Hashmap: Optimizing for Hash Functions: http://archive.oreilly.com/pub/a/onjava/2001/01/25/hash_functions.html Non blocking HashTable, well HashTable. Still you may be interested. http://www.azulsystems.com/blog/cliff/2007-03-26-non-blocking-hashtable The official docs: https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html   Check this back later. I will add more resources.

About

This site is all about Java HashMap. Whenever you want to keep a key and a value associated to that HashMap is the right data structure. The applications of HashMash and how it stores the data and retrieves it all I have tried to cover here. You will find articles, Illustrations and code samples here.… Continue reading About

Welcome

Welcome to the Java Hash Map. This site is dedicated for exploring the Java HashMap in depth. Keep visiting for in articles and code samples of Java HashMap