remove all elements in java arrayList code example
Example: remove all entries of arraylist
//Creating the ArrayList
ArrayList <String> names = new ArrayList<>();
//Removing all entries in the ArrayList using the clear() method
names.clear()
//Removing all entries in the ArrayList using the removeAll() method
names.removeAll(names)