Computer Applications
Distinguish between the following:
next() and next().charAt(0)
Input in Java
39 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
25 Likes