Advertisements
Advertisements
Question
Explain the following function:
nextLine();
Answer in Brief
Solution
The Scanner object's nextLine() method reads the complete input line of text. It accepts the string, including spaces.
Syntax:
Scanner ob = new Scanner(System.in);
String s = ob.nextLine();
shaalaa.com
Is there an error in this question or solution?