Category: Collection Framework

Add Element at a specified index

Add Element at a specified index

In the previous post, we have seen how to add an element to a LinkedList.In this post, we will see how to add element at a specified index. We will use method add(int index, Objects...

Adding an Element to a LinkedList

Adding an Element to a LinkedList

In the previous post, we have seen LinkedList in java.In this post, we will learn how to add element to a linkedList. We use the method add() to add the elements to the LinkedList. It...

LinkedList in java

LinkedList class in Java

In the previous post, we have learnt about the ArrayList in java. In this post, we will see about LinkedList class in java. LinkedList has the following features. LinkedList Class uses a doubly linked...

Swap two elements in arrayList

Swap two elements in arrayList

In the previous post, we have seen how to compare two arrayLists. In this post, we will see how to swap two elements in arrayList. We have a method called Collections.swap()  which is used...

Compare two arrayLists in java

Compare two arrayLists in java

In the previous post, we have seen how to find out first and last occurrence of elements in arrayList. In this post , we will see how to compare two arrayLists in java. We...

Find SubList of ArrayList

Find SubList of ArrayList

In the previous post, we have seen how to sort the arrayList by using comparable and comparator.In this post, we will see how to get a sublist from a ArrayList. Find SubList of ArrayList:...