Skip to content

Tag Archives: Java-List-Programs

List in Java contains index-based methods. This enables us to maintain the order collection. So this enables us to search, insert, delete, and even update… Read More
Given a value N, the task is to create a List having this value N in a single line in Java using Collection Framework only.… Read More
Given a value N, the task is to create a List having this value N in a single line in Java. Examples: Input: N =… Read More
Given a list in Java, the task is to remove all the elements in the sublist whose index is between fromIndex, inclusive, and toIndex, exclusive.… Read More
In this article, we will show the most efficient way, finding or picking an element from the List. The basic idea for pick an item from… Read More
ArrayList is a part of collection framework and is present in java.util package. It provides us dynamic arrays in Java. Though, it may be slower… Read More
Here are couple of differences between ArrayList and HashSet. Inheritance: Implementation: Implementation : ArrayList implements List interface while HashSet implements Set interface in Java. Internal… Read More
In this article you will learn difference between LinkedList and LinkedHashSet in java. Prerequisite: LinkedList : LinkedHashSet LinkedList class implements the List and Deque interface… Read More
Given an array list, find the first and last elements of it. Examples: Input : aList = {10, 30, 20, 14, 2} Output : First… Read More
Given an unsorted list of integers, find maximum and minimum values in it. Input : list = [10, 4, 3, 2, 1, 20] Output :… Read More
Given a list, we need to split into two news lists in Java. Input : list = {1, 2, 3, 4, 5, 6} Output :… Read More
Given a List of String, the task is to convert the List to a comma separated String in Java. Examples: Input: List<String> = ["Geeks", "ForGeeks",… Read More
Given an ArrayList with duplicate values, the task is to remove the duplicate values from this ArrayList in Java. Examples: Input: List = [1, 10,… Read More
Array has length property which provides the length of the Array or Array object. It is the total space allocated in memory during the initialization… Read More
Given a Stream, the task is to convert this Stream into ArrayList in Java 8. Examples: Input: Stream: [1, 2, 3, 4, 5] Output: ArrayList:… Read More