java - Confused at to why this arraylist code is not working? Includes alist.removeLast(); -


anyone know code does?

i confused, , doesn't work reason though in textbook.

here array list:

   arraylist<integer> alist = new arraylist<integer>();     while(!alist.isempty()){       alist.removelast();   } 

the alist.removelast(); piece of code has error in it

im not sure piece of code supposed , how work.

if exact code in textbook, textbook wrong. arraylist.removelast() not exist. however, linkedlist.removelast() exist.

and looks method taking strange approach emptying list.


Comments

Popular posts from this blog

Java sticky instances of class com.mysql.jdbc.Field aggregating -