0

Getting Errors in sololearn that dont appear in IDE

Basically what the title says. I have a code I am working on that works perfectly inside eclipse, but even just copy-pasting the code into the code playground gives me a null pointer exception on the site. I look at where it says the exception originates from, and it can't possibly be from that area, because its in an if statement that checks the array size before moving on. I am just about ready to pull my hair out in frustration, and am wondering if anyone knows why this occurs and how to get around it? Edit: I am expanding on the interpreter contest. https://code.sololearn.com/c8j6op5L7e1a/?ref=app I am trying to get some basic user input into the language itself. I got SoloLearn style input working on eclipse, but it gives errors when I moved it onto sololearn itself. Not where I would expect them for sure. Try using the input function and see for yourself. Copy it into an ide and watch it work perfectly.

21st Jul 2019, 7:30 AM
Taylor Houthoofd
Taylor Houthoofd - avatar
2 odpowiedzi
+ 3
Hello. Is it possible that you used a library like swing? Sololearn can only show your console. If not, it would be best to share your code, it is much easier to find your problem than to play 20 questions ;)
21st Jul 2019, 7:32 AM
Airree
Airree - avatar
0
I tried your 'demo program' and it works on SL. To run from the command line I had to change this in Interpreter () then it works as interactive. //while(keyboard.hasNextLine()) { String line=""; while(! line.equals("end\n") ) { source += line; line = keyboard.nextLine() + "\n"; }
21st Jul 2019, 12:02 PM
zemiak