Why is it that when the input to this code is "as, if, they" the program only prints out "as". | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why is it that when the input to this code is "as, if, they" the program only prints out "as".

https://code.sololearn.com/cFDRz92y1OAj/?ref=app

2nd May 2020, 9:19 AM
Uwem Neku
Uwem Neku - avatar
2 Respostas
+ 3
You should use method nextLine() instead of next() Cause next() takes only the next world, nextLine() takes the whole line
2nd May 2020, 9:33 AM
Marina Vasilyova
Marina Vasilyova - avatar
0
Thanks. This just proves the level of my amateur skills. šŸ˜‚. Thanks
2nd May 2020, 11:00 AM
Uwem Neku
Uwem Neku - avatar