Getting Started with Java
This is a 100% free course, but we need you to first join or login to watch this video.
Alright, join or login here.This video introduces you to the ArrayList in Java. An ArrayList is a flexible array capable of storing any type of data. You can use generics to specify which type of objects it should store. It cannot store primitive data types and you will have to use wrapper classes such as Double, Float, Integer, Long and Boolean for that. You can add(), insert(), remove(), replace() items in an ArrayList and easily use the for each loop to display all the items contained inside an ArrayList. The video also shows the difference between an Array and an ArrayList in Java and when to use an Array vs. when to use an ArrayList.