describe next() and nextline() in java?
Answers
Answered by
5
It can't read two words separated by 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). Once the input is read, nextLine() positions the cursor in the next line.
ZACKKY:
thanks for the answer
Answered by
17
next() can read the input only till the space. It can't read two words separated by 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).
If it is helpful to you then plzz follow me and mark me as brainlist.
10 thanks = 15 thanks
Similar questions