Five alternatives to Pair class in Java
A Pair is a container to store a tuple of two objects. Java doesn’t really provide any implementation of the Pair class. This post will discuss various alternatives to the Pair class in Java.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedA Pair is a container to store a tuple of two objects. Java doesn’t really provide any implementation of the Pair class. This post will discuss various alternatives to the Pair class in Java.
This post will discuss how to iterate over a stream with indices in Java 8 and above.
This post will discuss how to convert an iterable to stream in Java.
This post will discuss Base64 Encoding and Decoding using plain Java, Guava, and Apache Commons.
We can perform a reduction operation on elements of a Java Stream using the Stream.reduce() method that returns an Optional describing the reduced object or the reduced value itself. This post will discuss a few simple examples of the Stream.reduce() method.
This post will explore ways to increment a map value in Java 8 and above. If the map contains the mapping for the specified key, the solution should increment its value by 1; otherwise, it should associate 1 with the specified key.
This post will discuss how to clone a list in Java. We need to construct a list containing the specified list elements in the same order as the original list.
This post will explore several ways to determine whether a string is a valid number in Java. The solution checks if a string contains only Unicode digits and doesn’t allow either positive or negative leading sign or a decimal point.
This post will discuss how to insert an element into an array at the specified index in Java. The insertion should shift the element currently at that index and any subsequent elements to the right by one position.
This post will explore the major reasons behind the Vector class being obsolete in Java.
This post will discuss the difference between early and late binding (static and dynamic binding) in Java.
This post will discuss how to schedule a task for repeated execution in a Java application.