Forums Register Login

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

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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:
+Pie Number of slices to send: Send
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!
+Pie Number of slices to send: Send
Next time, check out the compiler errors (and to a lesser extent its warnings) before running your code.
+Pie Number of slices to send: Send
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:)
mooooooo ..... tiny ad ....
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1264 times.
Similar Threads
Head first Java - Chapter 4 Pool Puzzle p.91
WHat is Exception in thread "main" java.lang.NullPointerException ?
Head first java exercise JVM problem
Trying to understand Puzzle4..Head First
Puzzle 4
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:58:52.