Constructor overloading in c# | OOP in C# Part-10



C# Constructor

 In C#, constructor is a special method which is invoked automatically at the time of object creation. It is used to initialize the data members of new object generally. The constructor in C# has the same name as class or struct. There can be two types of constructors in C#.

Constructor Overloading

Constructor Overloading is a technique to create multiple constructors with a different set of parameters and the different number of parameters. It allows us to use a class in a different manner. The same class may behave different type based on constructors overloading.

إرسال تعليق

أحدث أقدم