Answers for "how to empty and array list"

2

clear an array list in java

// Creates an array list
ArrayList<String> arrayList = new ArrayList<>();

// Adds stuff to array list
arrayList.add("test");

// Clears array list
arrayList.clear();
Posted by: Guest on October-10-2021
0

java create empty arraylist

ArrayList<Class> myList = new ArrayList<Class>();
Posted by: Guest on March-12-2021

Code answers related to "how to empty and array list"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language