what is the difference between next() and next line()?
Answers
Answered by
1
Difference between next() and nextLine()
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).
Answered by
5
Question:
what is the difference between next() and next line()?
Answer:
- next() can read the input only till the space. It can't read two words separated by space.
- nextLine() reads input including space between the words (that is, it reads till the end of line \n).
Explanation:
Also, next() places the cursor in the same line after reading the input nextLine()
#BrainliestBunch
Similar questions