Whatโ€™s wrong with my code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Whatโ€™s wrong with my code?

Anyone know why I get 3 error messages not allowing my code to run properly? I directly copied and pasted from my book and Iโ€™ve been doing that and itโ€™s worked up until this piece of code class LowerToUpper { public static void main(String args[]) { char smallLetter, bigLetter; smallLetter = โ€™bโ€™; bigLetter = Character.toUpperCase(smallLetter); System.out.println(bigLetter); } }

22nd Apr 2022, 1:55 AM
WolfRhymes
WolfRhymes - avatar
2 Answers
+ 2
A common problem that came from copy/paste code, where some invalid characters (looking like spaces) accidentally copied over, and preventing the compiler from processing the code. Remove and retype this whole line smallLetter = 'b'; Lucky you it was just one line poisoned by invalid characters. Sometimes such characters spreads a whole code. Anyways, please note the use of tags on your future posts. We are expected to put relevant words in posts' tags ... https://code.sololearn.com/W3uiji9X28C1/?ref=app
22nd Apr 2022, 4:10 AM
Ipang
+ 1
I had a feeling that was the problem but i forgot to check. Thanks for your help. I should have Relevant tags but i didnt know what to write i just needed help real quick. Thanks again , God bless you ๐Ÿ˜Ž๐Ÿ‘๐Ÿ™
22nd Apr 2022, 4:12 AM
WolfRhymes
WolfRhymes - avatar