What is the main difference between next() and nextLine()? My main goal is to read the all text using a Scanner which may be \"con
next()
nextLine()
Scanner
Both functions are used to move to the next Scanner token.
The difference lies in how the scanner token is generated
next() generates scanner tokens using delimiter as White Space nextLine() generates scanner tokens using delimiter as '\n' (i.e Enter key presses)
next() generates scanner tokens using delimiter as White Space
nextLine() generates scanner tokens using delimiter as '\n' (i.e Enter key presses)