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?
10 Respostas
+ 2
Robert Haugland
I said there is small letter of L and you have written Capital letter of i
+ 1
Robert Haugland
there is "ln" in println not "In"
You have written caps of i instead of l
+ 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".
+ 1
Robert Haugland
No there should small letter (l) of L instead of capital letter of i
+ 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
+ 1
Robert Haugland
Yes they looks like same 😃😃 that's what the mistake.
+ 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.
0
AJ - SoloHelper,
So, am I to understand you are sayjng I should write "System.out.printLn" instead of "System.out.printIn"?
0
please share code link so we can check what is error and can find error
0
Java is case sensitive so
"System.out.println "
Is correct