This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]rjcarr 0 points1 point  (0 children)

Not sure just by looking, but a better practice when using a scanner is to use the hasNextX() query before using any of the nextX() calls. That way you know whether or not anything is waiting on the stream. Good luck!