Answers for "how to remove all items from arraylist in java"

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
0

remove all element in a list java

list_name.removeAll(list_name);
Posted by: Guest on July-17-2021

Code answers related to "how to remove all items from arraylist in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language