Computer Science
What are the advantages of Scanner Class? Explain.
Input in Java
11 Likes
Answer
The advantages of Scanner Class are:
- The end of data element can be determined through a special token.
- It not only reads data but also parses it into specific types like short, int, float, boolean, etc.
- It can read String as well as primitive data types.
- Sting manipulation is easier as each word can be obtained as a token and handled separately.
Answered By
5 Likes
Related Questions
Explain the use of Math.sin() mathematical function
What is a token? Explain these methods while reading token from Scanner object.
(a) nextlnt( ) (b) nextDouble( )
(c) next( ) (d) nextLine( )Explain the use of Math.atan() mathematical function
With reference to switch case, explain the following:
(a) Default case
(b) Fall through