Dear Kishan!
I have gone through your question, it's working smoothly.(Without any modification).
You try to execute the followed program. This is the revised version of your question.
Now in this prog. I have given no. to the statements.
If you write st.1 o/p will be Out constructor executed.
If write st. 2 o/p will be Out constructor exeecuted
Out constructor exeecuted
I am inner..
If you write st. 3 runtime exception is throw saying following
Exception in thread "main" java.lang.VerifyError :
(Class
uter,method signature);
([Ljava/lang/string
V) Expecting to find uninitialized object on stack.
***** program *****
class out
{
out()
{
System.out.println("Out Constructer executed");
}//out
static class inner extends outer
{
inner()
{
System.out.println("I am inner Constructor.. ");
}//inner
}//out class
public class outer extends out
{
public static void main(String args[])
{
outer o = new outer(); //1
inner i = o.new inner(); //2
inner i = new inner().new inner(); //3
}//main
}//outer
Be in touch.
Dharmesh.