Computer Applications
Distinguish between the following:
next() and nextLine()
Input in Java
46 Likes
Answer
next() | nextLine() |
---|---|
It reads the input only till the next complete token until the delimiter is encountered. | It reads the input till the end of line so it can read a full sentence including spaces. |
It places the cursor in the same line after reading the input. | It places the cursor in the next line after reading the input. |
Answered By
29 Likes