Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Collections framework: remove()
Posted by Steven Tolkin on April 24, 2000 at 5:41 PM
Exactly which element is affected by remove()? The tutorial http://java.sun.com/docs/books/tutorial/collections/interfaces/collection.html says "The remove method removes from the underlying Collection the last element that was returned by next." But this seems wrong. In fact I may nave started at the end of the list and only said previous, never next at all. Suppose I start at the beginning of the list [a, b, c, d, e] and say next, next, next, previous, previous. The cursor is between a and b. I believe that remove() will remove b. This is the element that the cursor "moved over" most recently. Is this correct?
Replies:
|