| Author |
Anonymous inner classes
|
Max Campa
Greenhorn
Joined: Oct 31, 2009
Posts: 10
|
|
Hi everyone,
I have a simple question about Anonymous inner classes. Given the following:
Does line 18 create a reference variable that refer to an instance of an anonymous subclass of Foo? Or it creates an instance of Foo?
Thanks
Max
|
 |
vijayakrishna Mikkilineni
Greenhorn
Joined: Nov 10, 2009
Posts: 24
|
|
|
It refers to an anonymous sub class of Foo.
|
Vijayakrishna M
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6592
|
|
|
Line 18 will refer to an anonymous implementation of the Foo class.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Anbarasu Aladiyan
Ranch Hand
Joined: Jun 02, 2009
Posts: 182
|
|
That line can be read as super class reference variable refers to the object of anonymous sub class.
Regards,
Anbarasu
|
A.A.Anbarasu
|
 |
Max Campa
Greenhorn
Joined: Oct 31, 2009
Posts: 10
|
|
|
Thank you all.
|
 |
 |
|
|
subject: Anonymous inner classes
|
|
|