Yet another Cannot Resolve Symbol
Hi, folks. I'm just at the beginning stages of learning Java, using a book: Java and XML: Your visual blueprint for creating Java-enhanced Web programs.
It's got a nice layout: some info at the top of the page, examples of text editors with code or command prompt with commands on the bottom.
I'm on Chapter 3, where I created an object (AuthorInformation) and it complied fine after I changed the Class to class on the very first word.
Then the book has me "instantiate" the object. It says to create a standalone program that instantiates the object.
So I follow that code precisely in my text editor.
This is what my first object looks like in code:
class AuthorInformation {
String EmailAddress() {
String message = "xxxxxxx@gmail.com";
return message;
}
}
Then my second, following exactly allong with the book:
class go {
public static void main(String[] args) {
AuthorInformation object1 = new AuthorInformation();
System.out.println(object1.EmailAddress());
}
}
Both of these are in the same directory on my computer (BookPractice). As I mentioned the first compiled fine (AuthorInformation.class). The second (go.java) will not. Javac constantly says Cannot resolve symbol and points to the capital A of AuthorInformation in both places it's used.
I've done the -classpath thing, though I don't quite get it. I have put the j2sdk1.4.0 path in my computer's path. So javac is in J:\Programming\j2sdk1.4.0\bin and I use javac j:\workspace\BookPractice\go.java as my command and get the above error.
I've checked and double-checked. It's just like the book shows. I've done javac -classpath .;J:\workspace\*.java;j:\workspace\BookPractice\*. java
What am I doing wrong? I'd really like to get past this so that I can move on with learning.
Do I need to put my files in a separate folder structure? Is this book just too outdated so that I need slightly different code? I could really use a coach here.
Thanks