java.util.scanner - Detected a new line within a series of numbers in Java -
let's have series of numbers like...
1 2 3 4 5 6 7 8 9 0 how step through each int, stop when reach new line? i'm using nextint() , know nextline() detect new line, i'm not sure how piece together. best take entire line, , parse string separate ints? or there more fluid method of doing this?
for example, want program store 1 2 3 4, 5 6 7 8, 9 0 in own separate array.
for more clarification, i'm using java.util.scanner , i'm reading text file.
if want use scanner, read entire line string, , construct scanner on string.
Comments
Post a Comment