Answers for "remove all entries of arraylist"

1

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)
Posted by: Guest on May-15-2021

Code answers related to "remove all entries of arraylist"

Browse Popular Code Answers by Language