Java Reference
In-Depth Information
public boolean
hasNextShort()
Returns
true
if the next token is a well-formed string representation of a
short
; otherwise
returns
false.
Throws:
IllegalStateException
if the
Scanner
stream is closed.
public double
nextDouble()
Returns the next token as a
double
, provided the next token is a well-formed string representation
of a
double.
Throws:
NoSuchElementException
if there are no more tokens.
InputMismatchException
if the next token is not a well-formed string representation of
a
double.
IllegalStateException
if the
Scanner
stream is closed.
public boolean
hasNextDouble()
Returns
true
if the next token is a well-formed string representation of a
double
; otherwise
returns
false.
Throws:
IllegalStateException
if the
Scanner
stream is closed.
public float
nextFloat()
Returns the next token as a
float
, provided the next token is a well-formed string representation
of a
float.
Throws:
NoSuchElementException
if there are no more tokens.
InputMismatchException
if the next token is not a well-formed string representation of
a
float.
IllegalStateException
if the
Scanner
stream is closed.
public boolean
hasNextFloat()
Returns
true
if the next token is a well-formed string representation of a
float
; otherwise
returns
false.
Throws:
IllegalStateException
if the
Scanner
stream is closed.
public
String next()
Returns the
next token.
Throws:
NoSuchElementException
if there are no more tokens.
IllegalStateException
if the
Scanner
stream is closed.