Playing with ArrayList
ArrayList is very useful in cases when the list needs to be modified a lot. It also offers us "positional access" - meaning if you want to know what object is at a specific index, you can directly access it.
The methods are named very simple and intuitive:
I think looking at the code, it's very self-explanatory:
In the code above, I have shown how to use add(), get(), remove() methods in ArrayList. As you can see, it's really easy!