This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help needen with Pool Puzzle excercise on page 91 Head First book...pleaseee

 
Krisztina Tarko
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

I am struggling since more than 1 hour on finding where the mistakes lies in my code from the Puzzle Exercise ..

Here is how I solved the exercise:

And even though i really CAN'T see any difference from the given solution in the book..i get the following error:

Can someone see where i'm wrong..you know how they say: another pair of eyes always help
Many many thanks
Kris.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd take Puzzle4b out of the Puzzle4 class. Make it a stand-alone class. Otherwise you'll need to do funny and ugly constructs like this one:


One other option is to make Puzzle4b a static inner class:
 
Krisztina Tarko
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah..that was it... i had the feeling that at this level it works to have them all in one..My mistake!!

Thanks a lot!

A good day!
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next time, check out the compiler errors (and to a lesser extent its warnings) before running your code.
 
Krisztina Tarko
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I know..it was a stupid mistake ..and sorry for takin your time with it..i just was stuck. But learned a good lesson!
again: Thanks a lot for your quick reply!

I promiss I won't be bothering again with such obvious things
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic