File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Head First Java chapeter 5 SimpleDotCom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Head First Java chapeter 5 SimpleDotCom" Watch "Head First Java chapeter 5 SimpleDotCom" New topic

Head First Java chapeter 5 SimpleDotCom

Rob Gman

Joined: Jan 20, 2008
Posts: 3
Some errors I found that hopefully will save some other beginners the time I have just spent working them out.

In order to get the code to work as quoted in 2nd Edition,

in SimpleDotComGame class, the line:

should read

or i guess you could change the name of GameHelper.class to helper.class. Also in GameHelper(/helper)

should read

hope that helps.

Another also is that I didn't think it was made obvious that each class needs to be saved in a separate .java file, but then only the one with the main method in needs to be compiled.
[ January 23, 2008: Message edited by: Rob Gman ]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46340
Welcome to the Ranch.

Please check the original code of the application carefully. I am sure they would have written "static" if they had meant the method to be static.

Maybe you were supposed to instantiate the GameHelper class to create an object called helper, and have forgotten to?
I agree. Here's the link:
subject: Head First Java chapeter 5 SimpleDotCom
It's not a secret anymore!