Under what conditions am I supposed to make the :base()
and :this()
constructor calls following my constructor\'s parentheses (or even in other pl
Look for "constructor chaining in C#". Basically, it looks like this:
MyClass():base() //default constructor calling superclass constructor
{
}
MyClass(int arg):this() //non-basic constructor calling base constructor
{
//extra initialization
}
It helps to remove code duplication in constructors - split them into basic and specific parts.