posted 16 years ago
Hi
neha
In inner = o.new In();
When the jvm executes this statement, the default constructor of the Out will be executed because in extends Out.There you are setting the id="Default",And in the inner class if you simply say id ,means this.id.Because In extends Out the id is inherited to the subclass because it is not declared as private.
This is a specaial syntax to get refernce to the top level class.
System.out.println(Out.this.id);//refers to
Out o = new Out("Hello");//line 1
In this the default constructor won't run.
Thanks
Anil Kumar
[ May 31, 2007: Message edited by: anil kumar ]
[ May 31, 2007: Message edited by: anil kumar ]