Home

ArrayList listIterator() method in Java

In this tutorial, we will see the listIterator() method of the ArrayList class in Java. Introduction ArrayList is a widely used class to store and retrieve data in a collection framework. In previous articles, we have various methods to perform operations on the ArrayList. A few methods of ArrayList class are add(), addAll(), remove(), set(...

Read more

ArrayList ensureCapacity() method in Java

In this tutorial, we will see the ensureCapacity(int minCapacity) method of the ArrayList class in Java. Introduction ArrayList is a widely used class to store and retrieve data in a collection framework. Unlike an array, ArrayList can dynamically grow in size. In previous articles, we have various methods to perform operations on the ArrayL...

Read more

ArrayList isEmpty() method in Java

In this tutorial, we will see the isEmpty() method of the ArrayList class in Java. This method is used to check if the ArrayList is empty or not. Introduction ArrayList is a widely used class to store and retrieve data in a collection framework. In previous articles, we have various methods to perform operations on the ArrayList. A few metho...

Read more

ArrayList removeAll() method

In this tutorial, we will see the removeAll(Collection c) method of the ArrayList class in Java. This method removes from this list all of its elements that are contained in the specified collection. Introduction ArrayList is a widely used class to store and retrieve data in a collection framework. We have seen how to remove elements from the...

Read more

ArrayList removeIf() method

In this tutorial, we will see the removeIf(Predicate filter) method of the ArrayList class in Java. This method removes all of the elements of this collection that satisfy the given predicate. Introduction ArrayList is a widely used class to store and retrieve data in a collection framework. We have seen how to remove elements from the ArrayL...

Read more

ArrayList lastIndexOf() method

In this tutorial, we will see the lastIndexOf() method of the ArrayList class in Java. This method returns the index of the last occurrence of the specified element in this list. Introduction ArrayList is a widely used class to store and retrieve data in a collection framework. Also, we have seen a few methods of the ArrayList class before li...

Read more

ArrayList indexOf() method

In this tutorial, we will see the indexOf() method of the ArrayList class in Java. This method returns the index of the first occurrence of the specified element in this list. Introduction ArrayList is a widely used class to store and retrieve data in a collection framework. Also, we have seen a few methods of the ArrayList class before like ...

Read more

ArrayList trimToSize() method

In this tutorial, we will see the trimToSize() method of the ArrayList class in Java. Introduction In the last few tutorials, we are looking at various methods of the ArrayList class in Java. We have seen a few methods of the ArrayList class before like add(), addAll(), remove(), set(), iterate(), clear(), contains(), get(), removeRange(), ...

Read more