Reputation: 9
so I decided to learn how to program. I started using an old book on how to program. i used the disc to install JDK 3.something and started reading. the first thing it has you program is a sample, similar to "hello world"
this is what I have, i typed it exactly how the book said to:
//My first java program
public class cooljava {
public static void main (String args[])
{
System.out.print1n("Java is Cool");
}
}
this is what i typed in command prompt:
c:\Users\johns_000\My Documents>javac cooljava.java
the path is completely correct.
this is what it said
cooljava.java:7: cannot find symbol
symbol : method print1n(java.lang.String)
location: class java.io.PrintStream
System.out.print1n("Java is Cool");
^
1 error
and thats it. please help. i dont want to continue until i can get this to work. P.S. i'm using windows 8. Thanks!
UPDATE: i switched the 1 to an I but it still came up with the same error, the only thing that changed was that it now says I instead of 1 in the error. any other suggestions? BTW, i am not updating jdk because im affraid that it wont work because the scripting language may have changed or something like that.
UPDATE AGAIN: i miss-read your answers, i put an i not an L. thanks for all of your help! it works perfectly now!
Upvotes: 0
Views: 552
Reputation: 85779
The error is a typo. The method is println
and you used print1n
Since you decided to learn Java, I would recommend to stop immediately and get the right tools. Use the latest JDK and use an IDE like Netbeans or Eclipse for your development.
Upvotes: 1
Reputation: 2580
You type wrong method
System.out.print1n();
You need
System.out.println();
instead.
Upvotes: 0
Reputation: 1600
It's System.out.println("Java is Cool");
You were misspelling println.
Upvotes: 3