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
Distinguish between the following:
next() and nextLine()
Distinguish between the following:
hasNext() and hasNextLine()
Using scanner class, write a program to input temperatures recorded in different cities in °F (Fahrenheit). Convert and print each temperature in °C (Celsius). The program terminates when user enters a non-numeric character.
Write a program to accept a set of 50 integers. Find and print the greatest and the smallest numbers by using scanner class method.