wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Head First Java chapeter 5 SimpleDotCom" Watch "Head First Java chapeter 5 SimpleDotCom" New topic
Author

Head First Java chapeter 5 SimpleDotCom

Rob Gman
Greenhorn

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
Sheriff

Joined: Oct 13, 2005
Posts: 38107
    
  22
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: http://aspose.com/file-tools
 
subject: Head First Java chapeter 5 SimpleDotCom
 
Similar Threads
Searching and replacing text in a string
Problem with a If statement
Help!!! I write the code it compiled but it can't run
Head First Java SimpleDotCom program
please help in rectifying error :Symbol not found