Computer Science, asked by vedikagawali, 10 months ago

differentiate between next() and next line()​

Answers

Answered by Anonymous
4

Explanation:

Also, next() places the cursor in the same line after reading the input. nextLine() reads input including space between the words (that is, it reads till the end of line \n). Once the input is read, nextLine() positions the cursor in the next line. Just for another example of Scanner.

Answered by Anonymous
2

Their differences are... next() can read the input only till the space. ... Also, next() places the cursor in the same line after reading the input. nextLine() reads input including space between the words (that is, it reads till the end of line \n).

hope it helps you

Similar questions