Computer Applications

Differentiate between hasNextInt( ) and hasNextBoolean( )

Input in Java

8 Likes

Answer

hasNextInt( )hasNextBoolean( )
Returns true if the next token in the Scanner's input can be interpreted as an int value using the nextInt() method.Returns true if the next token in the Scanner's input can be interpreted as a boolean value.

Answered By

4 Likes


Related Questions