English

Explain the following function: next(); - Computer Applications

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?
Chapter 1.06: Input in Java - EXERCISES [Page 66]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.06 Input in Java
EXERCISES | Q III. 3. | Page 66
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×