0

Can someone one help me please? What is wrong about this code? 😢

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

27th Mar 2019, 3:19 PM
Rory
Rory - avatar
5 Answers
+ 4
I didn't see there's any problem unless the name input contains a space e.g. "Donald Duck". If you want to accept names with spaces, use String name = s.nextLine(); at line 10. Maybe you can explain the problem?
27th Mar 2019, 4:11 PM
Ipang
+ 3
Same as Ipang. What is your problem?
27th Mar 2019, 4:17 PM
Seniru
Seniru - avatar
+ 3
Rory Input: Name Number Number all is fine. Example: Input: Name Number --> exception message: no such element --> zahlZwei can not get a value Same for: Input (nothing) But Exception handling is not important at the beginning. Keep it in mind and learn it when you are familiar enough wih Java. Edit: Exceptions are at the end of the Java lesson.
28th Mar 2019, 12:38 AM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Oh thank you. So always when I run the program it says that there is a Exception in thread "main" and that there would be No such elements exception at java.base So maybe this isn't a problem and I just don't understand what this means ( I started learning Java a few days ago). But thank you for your answers.
27th Mar 2019, 5:27 PM
Rory
Rory - avatar
+ 1
Thank you Denise Roßberg
28th Mar 2019, 6:30 AM
Rory
Rory - avatar