Check out example codes for "how to create an array list in java". It will help you in understanding the concepts better.

Code Example 1

ArrayList<Type> name = new ArrayList<Type>();

Code Example 2

//create ArrayList
ArrayList<String> arrayList = new ArrayList<String>();
//add item to ArrayList
arrayList.add("item");
//check if ArrayList contains item (returns boolean)
System.out.println(arrayList.contains("item"));
//remove item from ArrayList
arrayList.remove("item");

Code Example 3

List<Integer> list = new ArrayList<>();

Learn ReactJs, React Native from akashmittal.com