Check out example codes for "java arraylist remove". It will help you in understanding the concepts better.

Code Example 1

//Create the ArrayList
List<Integer> al = new ArrayList<>(); 
//Add the items
al.add(10);
al.add(18);
//Remove item(1 = 2and item in list)
al.remove(1);

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

public E remove(int index)	// returns removed element at index

Code Example 4

//Create the ArrayList
List<Integer> al = new ArrayList<>(); 
//Add the items
al.add(10);
al.add(18);
//Remove item(1 = 2nd item in list)
al.remove(1); 
>> [10]

Learn ReactJs, React Native from akashmittal.com