Tag Archives: Constructor

Constructor Chaining in C#

Constructor chaining is an approach where a constructor calls another constructor in the same class or base class. It is very useful when we have a class that defines multiple constructors. Before knowing how to use constructor chaining in C#. Let’s first see why we need constructor chaining. Example: We have a class called “Employee” and… Read More »

Constructor in C#

Constructor is special method of a class that name is same as class name. Main use of constructors is to initialize private fields of the class while creating an instance for the class. Constructor is automatically invoked or called when an instance of that class is created. When you have not created a constructor in the class, the… Read More »