Advertisements
Advertisements
Question
Explain the following function:
next();
Answer in Brief
Solution
When a line of text is entered into the Scanner object, the next() method will only get the first token.
Syntax:
Scanner ob = new Scanner(System.in);
String s = ob.next();
shaalaa.com
Is there an error in this question or solution?