Why is this code getting an error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why is this code getting an error?

I am now learning Java and I have written the following code (or at least the output portion): import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double score = scanner.nextDouble(); // your code goes here if(score>3.5){ System.out.printIn("Welcome"); }else{ System.out.printIn("Sorry"); } } } I keep getting the error message "Cannot find symbol". What am I doing wrong?

13th Sep 2021, 5:11 PM
Robert Haugland
Robert Haugland - avatar
10 Answers
+ 2
Robert Haugland I said there is small letter of L and you have written Capital letter of i
13th Sep 2021, 5:34 PM
A͢J
A͢J - avatar
+ 1
Robert Haugland there is "ln" in println not "In" You have written caps of i instead of l
13th Sep 2021, 5:13 PM
A͢J
A͢J - avatar
+ 1
AJ-Solohelper, I have tried it both ways with "System.out.printIn" ans "System.out.printin" and I still get the same error "line 0 Cannot find symbol".
13th Sep 2021, 5:28 PM
Robert Haugland
Robert Haugland - avatar
+ 1
Robert Haugland No there should small letter (l) of L instead of capital letter of i
13th Sep 2021, 6:14 PM
A͢J
A͢J - avatar
+ 1
Sorry for.the misunderstanding. I changed it to "l" (small case L) and it worked. They look exactly the same "l" (small case L) and "I" (large case i). Thanks
13th Sep 2021, 6:19 PM
Robert Haugland
Robert Haugland - avatar
+ 1
Robert Haugland Yes they looks like same 😃😃 that's what the mistake.
13th Sep 2021, 6:22 PM
A͢J
A͢J - avatar
+ 1
AJ-SoloHelper, The "println" eesolve also answers a question in the Java class regarding how to print on seperate lines. So easy but yet also easy to see the confusion. Again, thanks.
13th Sep 2021, 6:24 PM
Robert Haugland
Robert Haugland - avatar
0
AJ - SoloHelper, So, am I to understand you are sayjng I should write "System.out.printLn" instead of "System.out.printIn"?
13th Sep 2021, 6:09 PM
Robert Haugland
Robert Haugland - avatar
0
please share code link so we can check what is error and can find error
14th Sep 2021, 5:25 PM
Numan
Numan - avatar
0
Java is case sensitive so "System.out.println " Is correct
14th Sep 2021, 5:27 PM
Numan
Numan - avatar