• Post Reply Bookmark Topic Watch Topic
  • New Topic

Head First Java 2nd Edition - Page 112, chapter 5 - Gamehelper/simpledotcom/simpledotcomgame  RSS feed

 
john pep
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've typed up the code exactly as is written in the book, however, i keep getting errors when trying to compile.

Below is the copy of what i've typed up.




Could anyone with a sharp eye, knowledge and with a copy of the book point to where exactly I'm going wrong?

Thank you so much!
 
john pep
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've changed the Helper object instantiation, was previously upper case.
Still doesn't compile.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37507
552
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've added code tags to make the post more readable.

At a glance, you are missing imports. You need "import java.io.*;" at a minimum up top. (I do see it further down, but it needs to be on top if this is all in one file.) After adding that, can you post what compiler errors you get?
 
john pep
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SimpleDotComGame reaches the end of file while parsing, I'm trying to see if it's been closed properly.

I've added the import at the top thank you, the errors have been reduced by 1, 12 more to go!

Edit: the if statement in the first class used a colon, instead of the semi colon. this has now been changed. Errors are down to 11 now.
 
Johan Fourie
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. You have confused ( with { and { with ( a few times.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
john pep wrote:The SimpleDotComGame reaches the end of file while parsing, I'm trying to see if it's been closed properly.

I don't understand that at all. You mean, you're getting this as a compiler message for SimpleDotComGame.java?

Errors are down to 11 now...

And as Jeanne said: we can't do much unless we see them (the exact messages, please). Unless you're happy to just keep posting your error count.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!