0

hey! i have made a List object as follows:

List error = new LinkedList();

and then as per my requirements, i have added strings in it. like error.add(); like this. so, now at some time, i want this list to be empty, so i was doing error=null; which is giving me error of null pointer exception. so please help me how to do this? how can i make this list as empty ?

Edited by gourav1: n/a

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by gourav1
0

Do you mean that you want to remove all of the values in the linklist?

you can use the remove() on all the indexes

Edited by zeroliken: n/a

0

Do you mean that you want to remove all of the values in the linklist?

you can use the remove() on all the indexes

ya! ya! i want to remove all the elements from that at one time.. please tell me how to do that...how to use remove ??

0

Do you mean that you want to remove all of the values in the linklist?

you can use the remove() on all the indexes

ya i got it... thanks. u have solved the thread... :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.