C# Constructor
C# Constructor and its Types – A Detailed Look Definition: In simple terms, Constructor is a special kind of method with class name as method name and gets executed when its (class) object is created. This article will give you a detailed explanation on C# constructors and its types. Now, when we look at the above definition in a broader sense, a constructor is a class method that gets automatically executed whenever class’s object is created or whenever class is initialized. Consider following bit of code: public class MsDotNetHeaven { public MsDotNetHeaven() { //A default Constructor } //Class members } In the above snippet, the method MsDotNetHeaven() is called the constructor of class MsDotNetHeaven, also called default constructor. Behind the scenes What happen...
Comments
Post a Comment