Well the code does compile on my JDK!!
Now if the issue in here is whether its right to create an instance of the derived class during the process of creation of an object of the base class !! Well, its a bad design to do such a thing. Its a disaster! Why? Well, you as designer, design a class to represent a real life situation. Now,
the future requirement varrant that they inherent your the attribute/behaviour of your class plus some more additional
attributes/behavior. However, you as a designer have no knowledge as to how the future requirement change!!
Let me be elaborate, in the current context, in the code provided in this thread is being made to create an object of the derived object of the derived class during the creation process of the base class this leads to infinite calls to the base class's contructor. These calls are put on the stack of the memory and eventually your memory gets exausted and no more calls are possible, the JVM throws a stack overflow exception.
I hope this clears your doubts than confuse you.
[This message has been edited by Ravindra Mohan (edited October 03, 2001).]