nextInt

abstract fun nextInt(): Int

Returns the int value of the next token, consuming it. If the nexttoken is a string, this method will attempt to parse it as an int. If the next token's numericvalue cannot be exactly represented by a Java {@code int}, this method throws.

Throws

if the next token is not a literal value, if the next literal valuecannot be parsed as a number, or exactly represented as an int.