how to add an object to a list of objects in java

Java
import java.util.ArrayList;


ArrayList<typeOfList> list = new ArrayList<typeOfList>();
// Example
ArrayList<String> list = new ArrayList<String>();
Source

Also in Java: