1/4
Looks like no tags are added yet.
nextLine()
skips first: nothing
consumes: everything to the end of the line, plus the \n
returns: rest of the current line, without the \n
cursor ends up: Start of the next line
throws if it fails: NoSuchElementException if no lines remain
next()
skips first: leading whitespace (spaces, tabs, newlines)
consumes: the next token, up until whitespace (spaces, tabs, newlines)
returns: next token as a String
cursor ends up: just after the token
throws if it fails: NoSuchElementException if no tokens remain
nextInt()
nextDouble()
nextBoolean()
skips first: leading whitespace (spaces, tabs, newlines)
consumes: the next token, up until whitespace (spaces, tabs, newlines)
returns: next token as an int, double, or boolean
cursor ends up: just after token
throws if it fails: InputMismatchException if the token is not an int/double/boolean. the bad token is not consumed. the cursor doesn’t move.
NoSuchElementException if no tokens reamin
hasNextLine()
true whenever any input remains, even a lone newline
hasNext()
skips leading whitespace js as next methods do; is false when only spaces and newlines remain
checks on token ahead; doesn’t scan whole output