Below is the constructor of a struct named Complex with two member variables, Real and Imaginary:
public Complex(double real, double imaginary) : this()
{
Real = real;
Imaginary = imaginary;
}
What is the use of the part after the colon in the function header?
You can always make a call to one constructor from within another. Say, for example:
thisrefers to same class, so when we saythis(10), we actually mean execute thepublic mySampleClass(int Age)method. The above way of calling the method is called initializer. We can have at the most one initializer in this way in the method.In your case it going to call default constructor without any parameter