<Which exception should `Iterator.next` throw when...
# forum
r
Which exception should `Iterator.next` throw when there are no elements left? This doesn’t seem to be documented anywhere. I saw several *Array iterators in the standard library using NoSuchElementException. Upon searching further I found this EmptyIterator object also using NoSuchElementException, and as that’s what I was trying to make in the first place, I’ve copied that one (it’s...