Assuming that arraylist
is defined as ArrayList<String> arraylist
, is arraylist.removeAll(arraylist)
equivalent to arraylist.clear()
?
If so, can I assume that the clear()
method is more efficient for emptying the array list?
Are there any caveats in using arraylist.removeAll(arraylist)
instead of arraylist.clear()
?