It'll be a more effective learning experience if you try it yourself first. What do you think it will output? Or, try compiling and running it yourself. If you don't understand why it does what it does, come back to us and we can help you.
Joined: Jun 19, 2008
is it legitimate to initialize a same object twice in a program within a same class ?? besides the object is calling itself it will be a stack overflow error.
I am too not sure about this. I changed the name of the objects, put them as three different objects then also there is a stack overflow error. Seniors please reply.
Joined: Oct 13, 2005
You can't initialise the same object twice. You can initialise numerous instances of the same class, but they are different objects.
Write down some diagrams like those in this post, only you label the boxes t and t1 and t.t and t1.t etc etc. Then you can predict whether you will overflow your stack or not. As the chap who posted that older post said, pencil and paper and eraser. That's what you need to use