Back
Can anyone tell me what’s the difference between next() and nextLine() from scanner class?
nextLine(): To read input and to parse the string. It moves the scanner below after returning the current line.
next(): It returns any values which comes before delimiter (default to whitespace)
Interested in Java? Check out this Java Certification by Intellipaat.
31k questions
32.8k answers
501 comments
693 users