Name: rlT66838 Date: 06/08/2000
java version "1.2.2"
Classic VM (build 1.2.2-L, green threads, nojit)
- I checked on the website the same problem exists in 1.3.
In bug 4270728, the evaluator says this about java.util.Iterator:
"The fundamental issue is that iterators have no current elements.
ListIterators are positioned between two elements."
I'm one of these oldtimers that have started with C++. We oldtimers have grown
up thinking that an iterator points at an element.
This is a subtle, yet fundamental difference to how things operate in Java.
This can be confusing. I have just burned several hours trying to put my own
iterator class together. It just didn't work. No wonder: Java doesn't do it
the way I've been thinking (before I found that quote).
I have a feeling there are more people than I myself stuck in this problem.
There is an easy fix: Add a line or two to the documentation of
java.util.Iterator, basically repeating the above quote.
(Review ID: 105890)
======================================================================
- relates to
-
JDK-4650636 (coll spec) Description of ListIterator indexes is wrong.
-
- Resolved
-