Henry Wong wrote:Do you mean, given this....
How do you call the sizzle() method, of the anonymous inner class that subclasses the popcorn class?
The answer is... You can't. The sizzle method is not defined by any of its super classes or interfaces (which are still in scope).
Henry
I have posted before but my post seems get lost, so I will post again.
K&B says you cannot do it. So, for the sake of
SCJP, I will pretend we can't do it. However, as a curious
Java junkie, I believe that K&B is hiding something from us. So I did some research and this is what I found:
It's not a good example of "best practice of OO programming", but it made the point: It is possible to call method declared inside an anonymous class.