I know that an instance of an inner class must bind to an instance of the wrapper class and this lead me to question what happens to a wrapper class instance, when there is no reference to it but when there is still a reference to a bound instance.
So, is object referenced by otr eligible for garbage collection once the reference is set to null ?
class Outer
{
class Inner
{
}
}
class Test{
public static void main(String []args){
Outer otr = new Outer() ; // (1)
Outer.Inner oi = otr.new Inner() ; // (2)
otr = null ; // (3)
// more complicated code
}
}