Category: ArrayList in Java

Swap two elements in arrayList 0

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...

Find SubList of ArrayList 0

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:...

Sort ArrayList in java 0

Sort ArrayList in java

In the previous post, we have seen how to remove an element at a specified index. In this post, we will see how to sort arraylist in java. We use the collections class to...