KnowledgeBoat Logo

Computer Applications

Distinguish between the following:

next() and hasNext()

Input in Java

26 Likes

Answer

next()hasNext()
It reads the input till the next complete token until the delimiter is encountered.It checks if the Scanner has another token in its input.
It returns a String value.It returns a boolean value.

Answered By

16 Likes


Related Questions