1public static void main(String args[]){
2 ArrayList<Dog> doglist= new ArrayList<Dog>();
3 doglist.add(new Dog(“Joe”,”Husky”,3, white));
4 doglist.add(new Student(“Flash”,”German Shepherd",1, brown));
5 doglist.add(new Student(“Jason”,”Pitbull”,5,brown));
6}
7}
8
9
1//Create the Arraylist variable: . Replace the T with the type of
2//data to be stored in the list.
3ArrayList<T> exampleList = new ArrayList<>();
4//You can now perform operations on this ArrayList