I want to know the purpose. nextLine() method | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I want to know the purpose. nextLine() method

Please help me because i am beginner https://code.sololearn.com/c6W2l2O8K9ts/?ref=app

12th Jul 2020, 6:31 AM
born2code
born2code - avatar
2 Answers
+ 3
It reads the whole line and store in a String variable.
12th Jul 2020, 6:34 AM
Gordon
Gordon - avatar
+ 1
The nextLine() method of Java Scanner class is used to get the input string that was skipped of the Scanner object. https://www.geeksforgeeks.org/scanner-nextline-method-in-java-with-examples/ Thanks for your question and happy coding.
12th Jul 2020, 6:37 AM
James Clark I. Vinarao
James Clark I. Vinarao - avatar