0

That's odd task error. Java.

This code works in IDEA, but not here. I don't know where is mistake. https://code.sololearn.com/cioI8oBhHxCs

17th Jun 2021, 9:05 PM
Dewerro
2 Réponses
+ 3
seems that (at least) sololearn java compiler doesn't support more than one instance of Scanner... remove 'scanner1' declaration/initialization and replace it by scanner in 'console' assignement (inside loop): that will your code work here... if expected result was sum of even numbers (divisble by 2) ^^
17th Jun 2021, 9:16 PM
visph
visph - avatar
+ 1
Why you are using two Scanner object you can use same Scanner for all user input.. And when i remove second scanner from your code it works fine.
19th Jun 2021, 5:44 AM
Java Developer
Java Developer - avatar