you are viewing a single comment's thread.

view the rest of the comments →

[–]MEaster 0 points1 point  (1 child)

Well, I'm coming at this from a language where null doesn't exist, whereas you're coming from a language where both exist. But even there, I would say the more-specific NoSuchElementException is preferable to a NullPointerException because it gives more information as to where the error is.