Exception in solo learn but not in eclipse? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Exception in solo learn but not in eclipse?

I’m attempting to submit code for a challenge, specifically popsicles. It works perfectly fine in eclipse then I paste it into the challenge and it fails because “No such element exception in main”. When I go back to eclipse and use a try/catch block to get the exception it isn’t catching it. Any ideas what the issue is??

22nd Apr 2020, 8:01 PM
Julius Adams
6 Answers
+ 5
Hello Julius Adams Please show us your code. Wild guessing won't help you ;)
22nd Apr 2020, 8:05 PM
Denise Roßberg
Denise Roßberg - avatar
+ 3
Julius Adams Your code is not really wrong. That's why you will not get any error using eclipse. But: Sololearn does not support more than one Scanner. And the input on SL is a bit tricky. You have to enter all values at once. Only when you use nextLine() you have to press enter. An example: input form: anyInput anyInput This means for you, if the input is a number you need to convert it. int i = Integer.valueOf(yourScanner.nextLine()); If you would use nextInt() here, the user would have to enter the values in this form: anyInput [space] anyInput
22nd Apr 2020, 8:33 PM
Denise Roßberg
Denise Roßberg - avatar
22nd Apr 2020, 8:22 PM
Julius Adams
0
so just engineer it to a single scanner and it should take it?
22nd Apr 2020, 9:19 PM
Julius Adams
22nd Apr 2020, 9:32 PM
Denise Roßberg
Denise Roßberg - avatar
0
i edited into using a single scanner and SL accepted it TY!
23rd Apr 2020, 9:37 PM
Julius Adams