
A Guide to Java SynchronousQueue
1. Overview In this article, we’ll be looking at the SynchronousQueue from the java.util.concurrent package. Simply put, this implementation allows us to exchange information between threads in a thread-safe […]
1. Overview In this article, we’ll be looking at the SynchronousQueue from the java.util.concurrent package. Simply put, this implementation allows us to exchange information between threads in a thread-safe […]
1. Overview In this article, we will look at one of the most useful constructs java.util.concurrent to solve the concurrent producer-consumer problem. We’ll look at an API […]
1. Introduction In this article, we’ll focus on the PriorityBlockingQueue class and go over some practical examples. Starting with the assumption that we already know what a Queue is, […]
1. Overview We often use maps to store a collection of key-value pairs. Then, at some point, we often need to iterate over them. In this […]
1. Overview In this tutorial, we’re going to explore different ways to compare two HashMaps in Java. We’ll discuss multiple ways to check if two HashMaps are similar. We’ll also […]
1. Introduction In this quick tutorial, we’ll learn how to sort a HashMap in Java. More specifically, we’ll look at sorting HashMap entries by their key or value using: TreeMap […]
1. Introduction In this quick tutorial, we’ll demonstrate how to merge two maps using the Java 8 capabilities. To be more specific, we’ll examine different merging scenarios […]
1. Overview In this tutorial, we’ll learn about various ways of initializing a HashMap in Java. We’ll use Java 8 as well as Java 9. 2. The […]
1. Overview In this tutorial, we’re going to explore the available options for handling a Map with duplicate keys or, in other words, a Map which allows storing multiple […]
1. Overview Map is one of the most common data structures in Java, and String is one of the most common types for a map’s key. By default, a map […]
1. Overview In this article, we’ll see how to use HashMap in Java, and we’ll look at how it works internally. A class very similar to HashMap is Hashtable. Please […]
1. Overview It is sometimes preferable to disallow modifications to the java.util.Map such as sharing read-only data across threads. For this purpose, we can use either an […]
1. Overview EnumMap is a Map implementation that exclusively takes Enum as its keys. In this tutorial, we’ll discuss its properties, common use cases and when we should use it. […]
1. Overview In this article, we are going to explore the internal implementation of LinkedHashMap class. LinkedHashMap is a common implementation of Map interface. This particular implementation is a subclass of HashMap and […]
1. Overview Hashtable is the oldest implementation of a hash table data structure in Java. The HashMap is the second implementation, which was introduced in JDK 1.2. Both classes provide […]
1. Overview In this quick article, we’ll be looking at the ConcurrentSkipListMap class from the java.util.concurrent package. This construct allows us to create thread-safe logic in a lock-free way. […]
1. Overview Maps are naturally one of the most widely style of Java collection. And, importantly, HashMap is not a thread-safe implementation, while Hashtable does provide thread-safety by synchronizing operations. […]
1. Overview In this article, we will be looking at a WeakHashMap from the java.util package. In order to understand the data structure, we’ll use it here to roll […]
1. Introduction In this article, we’re going to compare two Map implementations: TreeMap and HashMap. Both implementations form an integral part of the Java Collections Framework and store data as key-value pairs. 2. Differences […]
1. Overview In this article, we are going to explore TreeMap implementation of Map interface from Java Collections Framework(JCF). TreeMap is a map implementation that keeps its entries sorted according […]