

If there is no constructor in a Non-Static class, a Public Default Constructor is provided by compiler so that a class can be instantiated.Default Constructor is called by compiler when no arguments are passed to New operator while creating an object of class or struct.A Constructor with no parameter is called Default Constructor.Constructors of derived class using :base() keyword.Another constructor of same class/struct using :this() keyword.

Compiler using New keyword to initialize a class/struct.

So, What is a Constructor?Ī Constructor is a special method in a class/struct with the same name as that of class/struct without any return type, used to initialize fields and members of a class/struct Today I will explain simple but important insights of Constructor. Constructors have a very special meaning to Compiler and CLR but sometimes its flow seems difficult for a developer.
