Example In the last tutorial we shared how to remove a specific mapping from HashMap based on key. In this example we are going to… [Read More]
Java – Remove mapping from HashMap example
Example In this example we are gonna see how to remove a specific mapping from HashMap using the key value of Key-value pair. We will… [Read More]
Difference between HashMap and Hashtable
What is the Difference between HashMap and Hashtable? This is one of the frequently asked interview questions for Java/J2EE professionals. HashMap and Hashtable both classes implements java.util.Map interface, however there are… [Read More]
How to loop HashMap in java
In this tutorial we will learn how to loop HashMap using following methods: For loop While loop + Iterator Example: In the below example we… [Read More]
How to serialize HashMap in java
HashMap class is serialized by default which means we need not to implement Serializable interface in order to make it eligible for Serialization. In this… [Read More]
How to sort HashMap in Java by Keys and Values
As we know that HashMap doesn’t preserve any order by default. If there is a need we need to sort it explicitly based on the… [Read More]
How to synchronize HashMap in Java with example
HashMap is a non-synchronized collection class. If we need to perform thread-safe operations on it then we must need to synchronize it explicitly. In this… [Read More]
Difference between ArrayList and HashMap in Java
ArrayList and HashMap are two commonly used collection classes in Java. Even though both are the part of collection framework, the way they store and… [Read More]
HashMap in Java With Examples
HashMap is a Map based collection class that is used for storing Key & value pairs, it is denoted as HashMap<Key, Value> or HashMap<K, V>…. [Read More]