Hi Payal,
Implicitly every class has its super class as java.lang.Object. Same is the case here.
When you try to instantiate class
Test, the Constructor is called first and then the instance variables gets initialized.However calling this(a) means you are calling Constructor Test(int) when a is still not initialized, i.e the Object of Test is still not created and hence instance varaible a is still not initialized.
The above problem could be solved, if you modify the code to :
Hope this helps,
Sandeep
SCJP2, OCSD(Oracle JDeveloper), OCED(Oracle Internet Platform) [This message has been edited by Desai Sandeep (edited July 28, 2001).]