• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

HFJ 2nd - Problem with SimpleDotCom  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm learning Java using Head First Java, 2nd Edition...
I'm at Chapter 5, constructing the SimpleDotCom game...

And I just got errors!

My classes:

SimpleDotCom ( 6 errors )


SimpleDotComGame ( 6 errors)


GameHelper (This one compiles fine)





What's wrong???

PS.I'm using Java 5.0 version ( jdk1.5.0_06 )

Thanks!
 
lowercase baba
Bartender
Posts: 12627
50
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post what errors you are getting? they actually tell you a lot of what's wrong.
 
author and iconoclast
Sheriff
Posts: 24220
40
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

There's an extra close brace on the line before the "Out of the loop" line; that messes up everything from that point on.

If you're using Notepad or something along those lines to edit your code: this is the kind of thing that any decent programmers editor would point out to you as you type.
 
Silvio Lobo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Errors from SimpleDotCom


Errors from SimpleDotComGame


Thanks!
 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Reader,
Check out the "checkYourself()" method properly. You will see an if condition missing.
 
Silvio Lobo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't believe it!
It works fine now! ( no compile errors! )

I'm so ashamed!! The if condition was there(in the book) and I didn't see it!

But, Thanks for all!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!