Hi all,
Here's a quote from javacaps' self review on Objective 6:
9. Which of the following statements are true?
[a] Inner classes cannot be defined private
[b] An anonymous class can be subclass of another explicit class
[c] An anonymous class can implement single interface
[d] An anonymous class cannot be both explicit subclass and implement an interface
My initial answer would be (b).
But, the javacaps' answer is (b), (c), (d)
I'm a bit confused here.. How can one anonymous class implement an interface? And what does option (d) really mean?
Please consider the following code:
The current code compiles & runs successfully (& as I expected). Now, the question is how to declare an anonymous class which implements Z, for example. And how the (d) option illustrates itself within the above code?
please anyone enlightened me...
thanks in advance
- eric