A constructor in C# is a member function of a class that contains the same name as its parent class. This function gets automatically invoked when an object class gets created. A constructor constructs values in data members while initializing the parent class.

There are five types of constructors - Static constructor, Private constructor, Copy constructor, Default constructor, and Parameterized constructor.

Suggest An Answer

No suggestions avaliable!