Join Slack
Communities
Powered by
<Which exception should `Iterator.next` throw when...
# forum
r
rss
01/20/2023, 6:29 AM
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...
Open in Slack
Previous
Next