how can I remove all the element in a arrayList ? static ArrayList addRecord = new ArrayList(); for(int i=0;i <addRecord.size(), i++) { //do some operation; } //destory the ArrayList here, what i want is there's no element in the array list here ...any ideas other than addRecord.remove to remove all the element in the arrayLIst thanks
the api is a great place to look for this kind of stuff... e.g. http://java.sun.com/j2se/1.4.2/docs/api/ (or whatever version your using) you can lookup things like Arraylist, and see what methods it has. In this case, clear() Removes all of the elements from this list.
Never ascribe to malice that which can be adequately explained by stupidity.
brian yuen
Greenhorn
Joined: Oct 20, 2003
Posts: 20
posted
0
Thanks very much..
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.