Constructor is a method that is called when instance of an object is created . They have the same name as a class. In our example default constructor is to be set with values such as eye color, skin color and mouse color. A constructor with at least one parameter is called parameterized constructor.
What is constructor in C# with real time example?
Constructor is a method that is called when instance of an object is created . They have the same name as a class. In our example default constructor is to be set with values such as eye color, skin color and mouse color. A constructor with at least one parameter is called parameterized constructor.