+ 3

Next & NextLine

What is the difference between next and nextLine ?!

11th Jan 2017, 12:21 AM
Omran Sulaiman
Omran Sulaiman - avatar
2 ответов
+ 6
Let's imagine that numbers are words. Then: Next reads only words. NextLine reads sentences. Example: input string: One 1 two 2 three 3 next will return only one word - 'One' nextLine will return all string - 'One 1 two 2 three 3'
11th Jan 2017, 12:36 AM
Vladimir Honcharenko
Vladimir Honcharenko - avatar
+ 4
That mean "next" not take the space just take the words if not accessed space Either "nextLine" can take words with space "sentences"
11th Jan 2017, 4:34 AM
Omran Sulaiman
Omran Sulaiman - avatar