Computer Science, asked by sattyamasiddhartha9a, 2 months ago

what is the difference between next() and next line()?​

Answers

Answered by kakashi00
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 TeacherUnknow
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