📜  删除 arraylist 的所有条目 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:34.398000             🧑  作者: Mango

代码示例1
//Creating the ArrayList
ArrayList  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)