what is the difference between scanner class element next ( ) and nextline ( )
Answers
Answered by
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