KnowledgeBoat Logo

Computer Applications

Distinguish between the following:

next() and next().charAt(0)

Input in Java

30 Likes

Answer

next()next().charAt(0)
It reads the input only till the next complete token until the delimiter is encountered.It reads the complete token and then the first character is returned using the charAt(0) method.
It returns the read data as a String value.It returns the read data as a char value.

Answered By

19 Likes


Related Questions