Anyone know what this code does?
I am very confused, and also it doesn't work for some reason even though its in my textbook.
Here is my array list:
ArrayList<Integer> alist = new ArrayList<Integer>();
while(!alist.isEmpty()){
alist.removeLast();
}
The alist.removeLast(); piece of code has an error in it
Im not sure what this piece of code is supposed to do and how to get it to work.