• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Java chapeter 5 SimpleDotCom

 
Rob Gman
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic