0

used a scanner, input works for the string name, int age, numberYear, and booThang, after that its states an error exception

hello, can someone please take a look at my code and help me figure out why its not working? can you //comment my errors and necessary changes. Thank you https://code.sololearn.com/cEpAwnfd9zL8/#java

6th Apr 2020, 7:37 PM
Pierre
2 Réponses
+ 3
Hello Pierre Your code works fine. But the input on sololearn is a bit tricky. Because you have to enter all values at the beginning. In this order: name [enter] numberYear [space] location[enter] booThang [enter] dateYear [space] v1 [enter] v2 [enter] v3 [click on submit]
6th Apr 2020, 7:53 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Complement: Every user input with next() (nextInt(), nextDouble() and so on) is space separated. Only when you use nextLine() you need to jump on the next line, because nextLine() takes the whole line.
6th Apr 2020, 7:57 PM
Denise Roßberg
Denise Roßberg - avatar