"Chris Uppal" <> wrote in message
news:438c39d0$1$20532$.. .
> Mike Schilling wrote:
>
>> If it's a list, why not just use an integer index to step through it;
>> this
>> works fine when elements are added to the end. Just remember to compare
>> it to the current size() rather than the size() when the iteration
>> started.
>
> And also remember to change the LinkedList (as in the OP's experiment)
> back to
> an ArrayList !
Only if performance is an issue
To be honest, I'm not sure why a LinkedList isn't a LinkedCollection, since
performing random-access operations on one is a bad idea. (Or conversely,
why there isn't a RandomAcesssList interface that adds those methods, while
List merely adds the listIterator() method).