0
class Example {
   public static void main(String args[]) {
     System.out.printIn("This is a simple Java program.") ;
   }
}

I tried to compile the code through Command prompt. The error message is as follows:

Example.java:3: error: cannot find symbol
     System.out.printIn("This is a simple Java program.") ;
               ^
  symbol:   method printIn(String)
  location: variable out of type PrintStream
1 error

I am a very beginner in java. Please help to understand the error.

lczapski
  • 4,026
  • 3
  • 16
  • 32

3 Answers3

5

You have written printIn rather than println. You have an uppercase i not a l (L). Thus the compiler cannot find the method, thus the error cannot find symbol occurs.

The ln in println is for line.

akuzminykh
  • 4,522
  • 4
  • 15
  • 36
1
class Example {
   public static void main(String args[]) {
     System.out.println("This is a simple Java program.");
   }
}

You had the wrong method name printIn instead of println.

ImtiazeA
  • 1,272
  • 14
  • 19
  • I have corrected the method as println. But no result in command prompt as follows:Microsoft Windows [Version 10.0.18362.720] (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\sanal>cd desktop C:\Users\sanal\Desktop>javac Example.java C:\Users\sanal\Desktop> – SANAL KUMAR P D Apr 07 '20 at 09:33
  • If you have Java <= 8 https://stackoverflow.com/questions/16137713/how-do-i-run-a-java-program-from-the-command-line-on-windows, for Java >8 https://www.infoq.com/articles/single-file-execution-java11/ Also, watch some decent video tutorial to have such issues resolved. – ImtiazeA Apr 07 '20 at 10:04
0

that is System.out.println yours not correct sentence so that its raised error