
Guide to the Java Queue Interface
1. Introduction In this tutorial, we’ll be discussing Java’s Queue interface. First, we’ll take a peek at what a Queue does, and some of its core methods. Next, we’ll dive into a […]
1. Introduction In this tutorial, we’ll be discussing Java’s Queue interface. First, we’ll take a peek at what a Queue does, and some of its core methods. Next, we’ll dive into a […]
1. Overview In this tutorial, we’ll show how to use the Java’s ArrayDeque class – which is an implementation of Deque interface. An ArrayDeque (also known as an “Array Double Ended […]
1. Overview In this article, we’ll be looking at the DelayQueue construct from the java.util.concurrent package. This is a blocking queue that could be used in producer-consumer programs. It […]
1. Overview In this article, we’ll be looking at the TransferQueue construct from the standard java.util.concurrent package. Simply put, this queue allows us to create programs according to the […]
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. […]