Skip to content

Tag Archives: Java-HashMap

The java.util.HashMap.size() method of HashMap class is used to get the size of the map which refers to the number of the key-value pair or… Read More
The java.util.HashMap.putAll() is an inbuilt method of HashMap class that is used for the copy operation. The method copies all of the elements i.e., the… Read More
The java.util.HashMap.put() method of HashMap is used to insert a mapping into a map. This means we can insert a specific key and the value… Read More
The java.util.HashMap.remove() is an inbuilt method of HashMap class and is used to remove the mapping of any particular key from the map. It basically… Read More
The java.util.HashMap.values() method of HashMap class in Java is used to create a collection out of the values of the map. It basically returns a… Read More
The java.util.HashMap.clear() method in Java is used to clear and remove all of the elements or mappings from a specified HashMap. Syntax: Hash_Map.clear() Parameters: The… Read More
Given two integers representing the Numerator and Denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the… Read More
Suppose we have an elements in ArrayList, we can count the occurrences of elements present in a number of ways. HashMap This data structure uses… Read More
Given an array, find the first element that appears even number of times in the array. It returns the element if exists otherwise returns 0.… Read More
HashMap is the Class which is under Traditional Collection and ConcurrentHashMap is a Class which is under Concurrent Collections, apart from this there are various… Read More
ConcurrentMap is an interface and it is a member of the Java Collections Framework, which is introduced in JDK 1.5 represents a Map that is… Read More
Prerequisites: ConcurrentMap The ConcurrentHashMap class is introduced in JDK 1.5 belongs to java.util.concurrent package, which implements ConcurrentMap as well as to Serializable interface also. ConcurrentHashMap… Read More
Prerequisite: Equals() and hashCode() methods in Java HashMap and HashSet use hashing to manipulate data. They use hashCode() method to check hash values. The default… Read More
In this article, I am going to explain how those collections behave which doesn’t iterate as fail-fast. First of all, there is no term as… Read More
We are given the details of marks scored by students in form of a HashMap, where name of the student is the Key and marks… Read More