How we can implement the constructer nesting in java

Questions by syedfarees

Showing Answers 1 - 2 of 2 Answers

Sujeet Mishra

  • May 31st, 2006
 

Constructor nesting can be achieved by using :

this(parameters....)

constructors with parameters can use the above to delagate calls to a non argument constructor and vice versa.

  Was this answer useful?  Yes

Ravindra Gautam

  • Jun 5th, 2006
 

constructor nesting can be achieved only by this(parameter,parameter,...............). it's called with in a constructor,and it must be the first statement within the constructor within which it is called.ex.... class A { A(){ this(20,30); } A(int a,int b) { // some code; //some code; } }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions