Data Structure

Java Pair class

Pairs in Java

Learn to work with key value pairs in Java using Pair classes e.g. javafx.util.Pair, ImmutablePair, MmutablePair (common langs) and io.vavr.Tuple2 class. Read More : Tuples in Java 1. Why we need pairs? A pair provide a convenient way of associating a simple key to value. In Java, maps are used to store key-value pairs. Maps …

Java Tuple (with Examples)

A tuple is an immutable wrapper object that holds different pieces of information. Learn to create tuples using a custom Java class and Javatuple library.

Java Stack Implementation using Array

This tutorial gives an example of implementing a Stack data structure using an Array. The stack offers to put new objects on the stack (push) and to get objects from the stack (pop). A stack returns the object according to last-in-first-out (LIFO). Please note that JDK provides a default java …

Custom List Implementation in Java

We may need to design our own custom list implementation for a very specific requirement or simply as a coding question in a Java interview.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.