This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This is a question from K & B Book, Chapter Inner classes, Page 669
See the explanation of Option c..
I know the correct option is C...But I feel there is something wrong in its explantion..
It tells it creates bar and then finally creates instance of anonymous subclass of bar..??
I think only one instance is created and that is instance of anonymous subclass of bar
am i correct..??
BOTTOM LINE : when makeBar() method is invoked, it creates an instance of anonymous subclass of bar, thus prints "bar" and then it invokes method go() on the newly created instance, so "hi" is printed.
Regards, Hardik.S.Raja [ May 04, 2007: Message edited by: Hardik Raja ]