Introduction to ArrayList

Get introduced to the ArrayList class in Java.

This section provides a very brief overview of the ArrayList class. Remember that an array is not resizable. Once an array is created, you cannot add more space in it afterwards.

What if we want to delete an element later on, or add an extra element in an array? That’s not possible. In this case, Java does provide the functionality of resizable arrays using a class called ArrayList. This class is part of the java.util package.

Creating an object of ArrayList type

An object of the ArrayList class is always mutable (can be changed afterwards).

Let’s create one.

Get hands-on with 1200+ tech skills courses.