| Author |
Inner Class instantiation through Interface Reference
|
Jayavardhan geepi
Ranch Hand
Joined: Jul 21, 2010
Posts: 66
|
|
Hi..
I have compilation error with followinf
I need Object of NestedInB class.
I have code like this
Can someone please help?
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12928
|
|
Your variable a is of type A (even though at runtime you're initializing it with a new B), and since class NestedInB is not in class A, this is not going to work.
You have to change a to a B:
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Jayavardhan geepi
Ranch Hand
Joined: Jul 21, 2010
Posts: 66
|
|
|
Thanks Jesper...
|
 |
 |
|
|
subject: Inner Class instantiation through Interface Reference
|
|
|