| Author |
object of inner class - where can't we make
|
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
At what place we can't make an object of regular inner class ??? thanks . [ January 11, 2005: Message edited by: rathi ji ]
|
 |
Jeroen Wenting
Ranch Hand
Joined: Oct 12, 2000
Posts: 5093
|
|
|
nowhere, with a bit of trickery you can instantiate them whereever you want to.
|
42
|
 |
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
I was also thinking the same . 1] inside outer class , inside a instance code : MyInner m = new MyInner(); 2] inside outer class , inside static code : MyOuter.MyInner m = new MyOuter.new MyInner(); 3] outside outer class ,inside any method static or instance : MyOuter.MyInner m = new MyOuter.new MyInner(); // MyOuter shuld be visible [ January 13, 2005: Message edited by: rathi ji ]
|
 |
 |
|
|
subject: object of inner class - where can't we make
|
|
|