M
Mike Barnard
Hi all
I am a TOTAL newbie, as discussed in another thread. I have finally
gotten the book Head First Java and I'm as far as page 9. This
describes a first .java file as follows.
public class MyFirstApp{
public static void main (String[] args) {
system.out.println("Hello world");
system.out.println("It's me");
}
}
I have a command line compiler set up and the code is entered via a
plain text editor. (NoteTabPro for now if anyone cares.) This is my
result...
G:\java\Projects>javac MyFirstApp.java
MyFirstApp.java:2: cannot find symbol
symbol : class string
location: class MyFirstApp
public static void main (string[] args) {
^
MyFirstApp.java:3: package system does not exist
system.out.println("Hello world");
^
MyFirstApp.java:4: package system does not exist
system.out.println("It's me");
^
3 errors
G:\java\Projects>
So I note that the caret is actually pointing at the "s" of string. I
know Java is case sensitive so I've tried it with both lower and upper
case in the source. I get the same result. The caret is pointing to
the dot in the system.out in the 2nd and 3rd errors.
So, has Java changed since the book was printed? Or am I making a
basic mistake? Thank you.
Mike.
I am a TOTAL newbie, as discussed in another thread. I have finally
gotten the book Head First Java and I'm as far as page 9. This
describes a first .java file as follows.
public class MyFirstApp{
public static void main (String[] args) {
system.out.println("Hello world");
system.out.println("It's me");
}
}
I have a command line compiler set up and the code is entered via a
plain text editor. (NoteTabPro for now if anyone cares.) This is my
result...
G:\java\Projects>javac MyFirstApp.java
MyFirstApp.java:2: cannot find symbol
symbol : class string
location: class MyFirstApp
public static void main (string[] args) {
^
MyFirstApp.java:3: package system does not exist
system.out.println("Hello world");
^
MyFirstApp.java:4: package system does not exist
system.out.println("It's me");
^
3 errors
G:\java\Projects>
So I note that the caret is actually pointing at the "s" of string. I
know Java is case sensitive so I've tried it with both lower and upper
case in the source. I get the same result. The caret is pointing to
the dot in the system.out in the 2nd and 3rd errors.
So, has Java changed since the book was printed? Or am I making a
basic mistake? Thank you.
Mike.