English

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

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?
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. 5. | Page 66
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×