How to use ArrayList class?
In this example we'll learn how to use the
java.util.ArrayList class. An
ArrayList is part of the Java Collection Framework. By using this class we can create a dynamic size array of data.
In the code above you have seen the demonstration on how to create an instance of
ArrayList, adds some items, remove item and iterates through the entire
When creating a class instance it is a good practice to use the
interface as the type of variable instead of the concrete type directly. This can make you easily change your application if you don't want to use