The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2000



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.


Collections framework: remove()

Posted by Steven Tolkin on April 24, 2000 at 5:41 PM

Exactly which element is affected by remove()?
The tutorial
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?


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us