0
Can someone one help me please? What is wrong about this code? đ˘
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?
+ 3
Same as Ipang. What is your problem?
+ 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.
+ 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.
+ 1
Thank you Denise RoĂberg