Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error while compiling  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jesper de Jong wrote:Try searching on the Web: I'm sure that you can find tutorials about using the Windows command prompt, which will explain the basic commands such as 'cd', 'dir' and others.



Thank Jesper have been able to get some good videos ...
I tried running this code
class HelloWorldApp{
    public static void main(String[] args) {
System.out.printIn("Hello World!"); // Display the string.
    }
}

but I get this error instead

C:\Users\User\Desktop\JavaWork>javac HelloWorldApp.java
HelloWorldApp.java:3: error: cannot find symbol
        System.out.printIn("Hello World!"); // Display the string.
                  ^
  symbol:   method printIn(String)
  location: variable out of type PrintStream
1 error

please how do I go about it where is my mistake. Thanks .
 
Marshal
Posts: 4410
281
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

printIn


Are you sure this is syntactically correct? It's worth double checking.
 
Bartender
Posts: 4230
48
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
misspelled println(), it's a lower case 'L' not an upper case 'I'.
 
Bartender
Posts: 611
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also did not import java.lang.System
 
Ranch Hand
Posts: 231
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Fred Kleinschmidt wrote:Also did not import java.lang.System


Is this import necessary?
 
Ranch Hand
Posts: 44
2
IntelliJ IDE Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Cox wrote:

Fred Kleinschmidt wrote:Also did not import java.lang.System


Is this import necessary?



As far as I learned everything in java.lang is automatically considered to be imported and so will System.out.println().
In simple programs I never use this import and they will compile fine.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!