Skip to content

Tag Archives: Java-List-Programs

LinkedList is a part of Collection framework present inside java.util package. This class is an implementation of LinkedList data structure which is a linear data… Read More
Given a Linked List in Java, the task is to convert this LinkedList to Array. Examples: Input: LinkedList: ['G', 'e', 'e', 'k', 's'] Output: Array:… Read More
In Java, as we all know ArrayList class is derived from the List interface. Here we are given an ArrayList of strings and the task… Read More
Given an ArrayList, the task is to make this ArrayList read-only in Java. Examples: Input: ArrayList: [1, 2, 3, 4, 5] Output: Read-only ArrayList: [1,… Read More
Given an unsorted ArrayList, the task is to sort this ArrayList in ascending order in Java. Examples: Input: Unsorted ArrayList: [Geeks, For, ForGeeks, GeeksForGeeks, A… Read More
Given an unsorted ArrayList, the task is to sort this ArrayList in descending order in Java. Examples: Input: Unsorted ArrayList: [Geeks, For, ForGeeks, GeeksForGeeks, A… Read More
Given two ArrayLists in Java, the task is to join these ArrayLists. Examples: Input: ArrayList1: [Geeks, For, ForGeeks], ArrayList2: [GeeksForGeeks, A computer portal] Output: ArrayList:… Read More
Given a String, the task is to convert it into comma separated List. Examples: Input: String = "Geeks For Geeks" Output: List = [Geeks, For,… Read More
Given an ArrayList in Java, the task is to write a Java program to find the length or size of the ArrayList. Examples:  Input: ArrayList:… Read More
Prerequisite: ArrayList in Java Given two ArrayLists, the task is to print all common elements in both the ArrayLists in Java . Examples: Input: List1… Read More
Prerequisite: ArrayList in Java Given an ArrayList, the task is to remove repeated elements of the ArrayList in Java. Examples: Input: ArrayList = [1, 2,… Read More
Prerequisite: ArrayList in Java Given an ArrayList, the task is to remove all elements of the ArrayList in Java. Examples: Input: ArrayList = [1, 2,… Read More
Prerequisite: ArrayList in Java Given an ArrayList, the task is to get the first and last element of the ArrayList in Java, Examples: Input: ArrayList… Read More
Given a Vector, the task is to Convert Vector to List in Java Examples: Input: Vector: [1, 2, 3, 4, 5] Output: List: [1, 2,… Read More
Given a Stream of Lists in Java, the task is to Flatten the Stream using forEach() method. Examples: Input: lists = [ [1, 2], [3,… Read More

Start Your Coding Journey Now!