• 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

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic