+ 5
Can anyone help?
Please check, inspect and run this program and please tell me why it is showing compilation error. https://code.sololearn.com/cyW7jxvOIjQ6/?ref=app
6 ответов
+ 5
https://code.sololearn.com/c3BtMvjXmSfZ/?ref=app
To fix your code I had to remove or comment out the break statement (if, else if, else don't use break); enclose multiple statements within curly braces when following an if, else if or else; replace the non printable characters with printable ones, e.g. '@'.
+ 3
Pranav Karawale
Pranav read comments in the link I provided in the code :
https://code.sololearn.com/cZ0WMWxE84dq/?ref=app
exceptions:
https://www.sololearn.com/learn/Java/2175/?ref=app
+ 2
Thank you guys for your valuable support. Check my other threads
https://www.sololearn.com/discuss/1763181/?ref=app
https://www.sololearn.com/discuss/1761662/?ref=app
https://www.sololearn.com/discuss/1762858/?ref=app
+ 1
Where is the switch in your code?
+ 1
1) Use braces { } to pack multiple lines after if or else statements.
2) break is only allowed in loops or switch statements, not in your if/else-construct.
3) seems like the character you chose cannot be mapped. I tried it with x instead of your dot and it worked.
0
Java doesn’t recognize the character, maybe use some kind og UTF encoding?
Also, brackets around multiple statements in conditionals eg.
if(condition)
{statement1;
statement2}