What does this error message mean ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What does this error message mean ?

"Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at Program.main(Program.java:8)"

17th Jun 2017, 9:17 AM
Ahmed Mohammed Ahmed Khodary
Ahmed Mohammed Ahmed Khodary - avatar
4 Answers
+ 3
Thanks all Venkatesh Pitta you were right
20th Jun 2017, 8:23 AM
Ahmed Mohammed Ahmed Khodary
Ahmed Mohammed Ahmed Khodary - avatar
+ 2
Maybe you didn't import your Scanner class so try importing it with import java.util.Scanner or according to @David Stark import java.util.*
17th Jun 2017, 2:46 PM
Lini Benson Jr
Lini Benson Jr - avatar
+ 1
hard to say for sure without looking at the source. so here is my stab at it. the compiler is trying to tell you there is no method called next defined in the Scanner class.
19th Jun 2017, 8:57 PM
Venkatesh Pitta
Venkatesh Pitta - avatar
0
maby try java.util.*
17th Jun 2017, 2:17 PM
D_Stark
D_Stark - avatar