Computer Science, asked by ghoshanjan525, 9 months ago

what is the difference between scanner class element next ( ) and nextline ( )​

Answers

Answered by rishavsharma21pd1prg
9

Answer:

Difference between next() and nextLine()

nextLine(): Advances this scanner past the current line and returns the input that was skipped. 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.

Similar questions