+ 2
Why does the SoloLearn IDE show a different line number to the line of the exception?
I've noticed on many occasions that the SoloLearn IDE gives a line number different to the line of the exception. https://www.sololearn.com/post/482329/?ref=app
5 Answers
+ 3
hey i just noticed same is the case with cpp ide and many other languages too here.
quick tips: accept it as a feature and whenever you see this error just do lineNo-1.đ
+ 3
Compiler search for semicolon till next valid token.. So it's found on line 4 without prevoius variable declaration closed.. So it saying Expected ; at line 4.
Check by adding semicolon just before like ; String a;
+ 2
I think code is shorted and prepared before it is compiled, so compiler has different version eg without comments, empty lines, with rewritten Scanner command.
+ 1
Yes that works. I'm sure there's some reason, maybe a package declaration we can't see. But it seems if you import a utility the line numbers match.
+ 1
zemiak, I think that might be the case.