• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Head First Java chapeter 5 SimpleDotCom

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic