| Author |
head first design patterns problem
|
dick kromkamp
Greenhorn
Joined: Sep 28, 2008
Posts: 2
|
|
Hello everybody, I started to read the book 'head first design patterns', but I already got a problem. I want to compile this code, but then it said: How do you compile this? greetz [ September 29, 2008: Message edited by: dick kromkamp ]
|
 |
tapeshwar sharma
Ranch Hand
Joined: Mar 10, 2006
Posts: 245
|
|
The book gives only that part of the code that is necessary to make the reader understand the concept.The fly() etc. methods are a "don't care" vis-a-vis driving the concept home. However, since you have raised this question, it makes me think that may be you are jumping ahead of yourself by reading Design Patterns. May be you should read Java basics first.
|
 |
dick kromkamp
Greenhorn
Joined: Sep 28, 2008
Posts: 2
|
|
That's not true, I only posted a part of the code on page18. The fly() methods etc are in the FlyBehavier and QuickBehavier. Anyone can help who had read this book? [ September 28, 2008: Message edited by: dick kromkamp ] [ September 28, 2008: Message edited by: dick kromkamp ]
|
 |
Steve Luke
Bartender
Joined: Jan 28, 2003
Posts: 3026
|
|
Originally posted by dick kromkamp: That's not true, I only posted a part of the code on page18. The fly() methods etc are in the FlyBehavier and QuickBehavier. Anyone can help who had read this book? [ September 28, 2008: Message edited by: dick kromkamp ] [ September 28, 2008: Message edited by: dick kromkamp ]
So if fly() is part of the FlyBehavior object, how do you think you should call the fly() method from that object? As a hint, the code you posted IS NOT the code that is on page 18 of the book. You screwed up copying it. Can you see where? If you had a solid knowledge of Java Basics, as has previously been suggested, you should have been able to see the error right away. [ September 28, 2008: Message edited by: Steve Luke ]
|
Steve
|
 |
 |
|
|
subject: head first design patterns problem
|
|
|