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??
6 Respostas
+ 5
Hello Julius Adams
Please show us your code. Wild guessing won't help you ;)
+ 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
0
so just engineer it to a single scanner and it should take it?
0
Julius Adams
Yes.
0
i edited into using a single scanner and SL accepted it TY!