+ 3

What is the difference between .nextline() and .next()

11th Oct 2017, 1:15 PM
Gaurav Nagar
Gaurav Nagar - avatar
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>
11th Oct 2017, 2:09 PM
Arl Kheem Rey B. Galario
Arl Kheem Rey B. Galario - avatar