KnowledgeBoat Logo

Computer Science

What are the advantages of Scanner Class? Explain.

Input in Java

11 Likes

Answer

The advantages of Scanner Class are:

  1. The end of data element can be determined through a special token.
  2. It not only reads data but also parses it into specific types like short, int, float, boolean, etc.
  3. It can read String as well as primitive data types.
  4. Sting manipulation is easier as each word can be obtained as a token and handled separately.

Answered By

5 Likes


Related Questions