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 any body tell whats this "optional" means.
- Does this affect the robustness of operation(Like c++ ,it does not guarantees the robustness of the operations.)
- Why "optional" has been specified categorically here.
- in second line of documentation
behavior of an iterator is unspecified if the underlying collection is modified
whats modification really means here?