Scanner
methodsMethod name | Description |
---|---|
next()
|
reads and returns the next token as a String
|
nextLine()
|
reads and returns as a String all the characters up to
the next new line (\n )
|
nextInt()
|
reads and returns the next token as an int , if
possible
|
nextDouble()
|
reads and returns the next token as double , if
possible
|
hasNext()
|
returns true if there is still a token in
the Scanner
|
hasNextLine()
|
returns true if there is still at least one line left
to be read in the Scanner
|
hasNextInt()
|
returns true if the next token can be read as
an int
|
hasNextDouble()
|
returns true if the next token can be read as
an double
|