Computer Applications

Distinguish between the following:

next() and hasNext()

Input in Java

24 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

15 Likes


Related Questions