+ 3
What is the difference between .nextline() and .next()
1 Answer
+ 5
.nextLine() = reads a line of string including the spaces
.next() = reads word SEPARATED with space ,it will not read any string after the space.
input: hello world
using .nextLine() will save hello world
but
using .next() will only save hello
when you want to save hello world in .next() you need to input: hello <enter> world <enter>
Hot today
sizeof funtion with a loop in c!
1 Votes