03J-2017 – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-ICSE2017-03J #JAVA#7251    siteicon   siteicon  

Problem Statement - 03J-2017

What is the difference between the Scanner class functions next() and nextLine()?

Solution

TC++ #7251

next() reads a single token i.e. all characters from the current position till a whitespace is encountered.

nextLine() reads an entire line i.e. all characters from the current position till a new line is encountered.


Share

CSKC| Created: 15-Apr-2019 | Updated: 27-Nov-2019|ICSE2017









Back