Computer Science, asked by iamadityasrivastava1, 1 day ago

What is the difference between the next ( ) and next line ( ) methods of the class

Answers

Answered by MichSuchana91
0

Difference between next and next Line-

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 xxitssagerxx
4

\huge\sf\fbox\purple{ ♡ Solution ♡ }

★ Explanation ★

  1. 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).17
Similar questions