Chaining Constructor
what is chaining constructor?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Oct 9, 2013, 5:55 AM
hi,
chaining constructor is an approch in which a constructor calls another constructor in the same class or base class.
please refer following link it might help you.
http://csharp.2000things.com/tag/constructor-chaining/
http://programmers.stackexchange.com/questions/200390/need-help-understanding-constructor-chaining
Sanjeeb LenkaPosted Oct 9, 2013, 3:39 AM
Hi,
Constructor Chaining is an approach where a constructor calls another constructor in the same or base class.
Refer to this link for details:
http://www.codeproject.com/Articles/271582/Constructor-Chaining-in-Csharp
VulpesPosted Oct 9, 2013, 2:47 AM
class MeaningOfLife
{
public MeaningOfLife() : this (42)
{
// default constructor, passes 42 to other one which does the work
}
public MeaningOfLife(int i)
{
// code
}
}