I'm having a problem replacing an element in my list with a null object.
From what I have read this should be possible but when I try to, the object I want to replace is removed but the the null object is put in its place.
I'm getting a ListIterator for the list and manipulating the list through the ListIterator methods.
Just wanted to know if what im trying to do is possible or a suggestion for a work around
Sorry I meant to say that I want the object to be replaced with a null.
Instead the object is removed and the size of the list is decreased.
No replacement happens.
Joined: Oct 13, 2005
That's what I meant about terminating the List; setting a node to null will signal that this present node is now the "last" node.
Joined: Feb 13, 2009
I can still traverse the list later on, so the list doesn't become terminated.
I presume using the set method wouldn't terminate the list, it would just replace the last object returned by the iterator to the object passed in.