The clear method of ArrayList clears a specific element code example
Example: how to reset an arraylist in java
There are two ways to empty an ArrayList:
1. By using ArrayList.clear() method or with the help of ArrayList.
2. removeAll() method.
There are two ways to empty an ArrayList:
1. By using ArrayList.clear() method or with the help of ArrayList.
2. removeAll() method.