I went through the documentation(http://java.sun.com/javase/6/docs/api/java/util/Iterator.html) of Iterator.remove()
there remove(
) was described as
void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
- So can anybody tell what "optional" means.
- Does this affect the robustness of operation?(Like c++ ,it does not guarantee the robustness of the operations.)
- Why "optional" has been specified categorically here.
- What does "modification" mean in the second line of documentation
behavior of an iterator is unspecified if the underlying collection is modified