Assuming you’re talking about java.util.Scanner
, the default delimiter is whitespace. Therefore, if you enter “14 45 20 16” on the command line and then pressed the enter key, the nextInt
or next
call on the scanner instance would return 14. If you then call nextInt
on scanner again, you get no prompting; that would immediately return 45. Another 2 calls would return respectively 20 and 16. If you then call nextInt
a fifth time, that call would wait until you typed something.
solved On the subject of delimiters