Category: Core Java

Core Java

Java – Remove all nulls from a List

Introduction: In this article, we’ll learn how to remove nulls from a Java List using plain-old Java, Java 8 lambda expression, and some third-party libraries. So, let’s get started! Removing nulls from a List In Java: Let’s explore different ways in which we can remove nulls from a Java List: 1. Java 7 or lower versions: […]

Be the First to comment. Read More
Core Java

LinkedList In Java

Introduction: A LinkedList is a linear data-structure composed of nodes. In a singly linked list, each node contains data and a reference. Here, the reference-part refers to the next node in the linked list. In a doubly linked list, on the other hand, we have data and references to both previous and next nodes. Java […]

Be the First to comment. Read More
Core Java

Java UUID

Introduction: UUID (Universal Unique Identifier) represents a 128-bit long unique value. It’s also popularly known as GUID (Globally Unique Identifier). The standard representation of UUID is made up of hexadecimal digits: 533a4559-e55c-18b3-8456-555563322002 And has 36 characters that include four hyphens ‘-‘. java.util.UUID class in Java represents an immutable UUID. We can use UUID class for […]

Be the First to comment. Read More
Core Java

Java Queue Interface

Introduction: A Queue is a FIFO (First In First Out) abstract data type (ADT). In other words, the elements are removed in the order in which they were inserted. The java.util.Queue is an interface in Java and extends from java.util.Collection. Some of the commonly used Queue implementation classes include a LinkedList, an ArrayDeque and a […]

One comment Read More
Core Java

Using Spliterator In Java

Introduction: Iterators in Java are used to traverse elements of a given source. Spliterator in Java is one among the four available Java Iterators – Iterator, Enumeration, ListIterator, and Spliterator. It is an interface available in java.util package. Spliterator was first introduced in Java 8 to support parallel programming. However, we can use it for […]

Be the First to comment. Read More
Core Java

Java TreeMap vs HashMap

Introduction: In this quick post, we’re gonna look at the similarities as well as the differences between Java HashMap and TreeMap. Similarities: Before we dive into the differences between Java HashMap and TreeMap, let’s first look at their similarities: Both extend java.util.AbstractMap class and are part of Java Collections API Both of these Map implementations aren’t […]

Be the First to comment. Read More
Core Java

Primitive Type Streams In Java

Introduction: In this tutorial, we’ll learn how to use the Java 8 Streams API with the primitive data types. Java 8 Streams API is a powerful API to efficiently process a sequence of elements. If you wish to learn about Java 8 Streams API, please check out this tutorial. Stream Over Java Primitives: As we […]

Be the First to comment. Read More
Core Java

Java DAO Pattern

Introduction: The DAO or the Data Access Object pattern is a very popular structural design pattern that separates the persistence logic in a separate layer. The idea is to abstract or hide the database logic from the business layer. It helps in hiding unnecessary CRUD operation and storage details from our service layer so that […]

2 comments Read More
Core Java

Java ClassLoaders

Introduction: In this tutorial, we’ll learn what is a classloader in Java. We’ll also look at various types of available Java Classloaders. A Classloader in Java is responsible for loading the required classes in memory dynamically at runtime. The classes aren’t loaded in memory all at once but rather when really needed by the application. […]

Be the First to comment. Read More
Core Java

Pairs In Java

Introduction: A Pair is an abstract data type which stores two items together which may or may not be related. They come handy when we want to track two objects together. We often feel the need to work with Pairs, specifically in competitive programming problems. In this tutorial, we’ll cover ways to define or use […]

Be the First to comment. Read More