Extending an Array’s Length 1. Overview In this tutorial, we’ll take a look at the different ways in which we can extend a Java array. Since arrays are a contiguous block of memory, the answer may not be readily apparent, but let’s unpack that now. 2. Using Arrays.copyOf First, let’s… Continue Reading java-array-add-element-at-the-end

Converting between an Array and a List in Java 1. Overview This quick article is going to show how to convert between an Array and a List using core Java libraries, Guava or Apache Commons Collections. This article is part of the “Java – Back to Basic” series here on… Continue Reading convert-array-to-list-and-list-to-array

Intersection Between two Integer Arrays 1. Overview In this quick tutorial, we’ll have a look at how to compute the intersection between two Integer arrays ‘a’ and ‘b’. We’ll also focus on how to handle duplicate entries. For the implementation, we’ll use Streams. 2. Membership Predicate for an Array The intersection… Continue Reading java-array-intersection

An Introduction to Apache Commons Lang 3 1. Overview The Apache Commons Lang 3 library is a popular, full-featured package of utility classes, aimed at extending the functionality of the Java API. The library’s repertoire is pretty rich, ranging from string, array and number manipulation, reflection and concurrency, to the implementations… Continue Reading java-commons-lang-3