0
Compilation error on java beginners programm
Hey, I am trying to start java coding and run into compilation errors. As a newbee I could not figure out why. It is the first time I use the scanner method, so I am not confident it is done correctly, but Icould not figure out my error from the tutorials. Would you be so kind as to help me with my learning roadbloc? Edit. How frustrating. I put the code in as an insert, but this seems nit to have worked either. So sorry. I hope it is in now. https://code.sololearn.com/cbHMnsELYnGD/?ref=app https://code.sololearn.com/cbHMnsELYnGD/?ref=app
4 Answers
+ 1
Your code is full of special space characters, known as no-break spaces.
They are not like normal spaces. That's why the editor displays them as a weird dot . in a pink background. They normally *look* like normal spaces are they're invisible characters that are supposed to be the same width as a normal space. But they're not normal spaces, and it is fortunate that some tools will make them stand out.
It's a very weird problem to have. Normally you wouldn't get these completely abnormal spaces unless you were actively trying to have spaces that are not the normal ones.
As they're not normal spaces, you're not allowed to put them in your programs. Well, you can have them in comments if you wish (useless, but you may) or inside Strings. But not anywhere else.
Replace the special spaces with normal spaces.
0
You gotta post your code and your error. We don't know what's wrong.
0
without your code it would be difficult to pin-point your issue, Iâd suggest reading about the Scanner class.
One resource: https://www.geeksforgeeks.org/scanner-class-in-java/
0
Hey,
I found the problem :)