15
Reply

What is type of constructor?

Sandeep Kumar

Sandeep Kumar

8y
1.3k
1
Reply

    If a constructor is explicitly declared by using Static modifiers it's Static Constructor otherwise others are Instance Only

    Need more clarification on question. Are you asking Types of constructor or type of constructor.if we are saying what are different types of constructor then answer would be static and Instance constructor. Instance constructor can be further classified into Default ConstructorParameterized ConstructorCopy ConstructorPrivate Constructor If we are asking about type of a constructor. then answer would be constructor dont have a type/return type.

    Static Constructor Instance Constructor

    There is 2 type of constrctor. 1.Instance constructor 2.non instance constructor

    1.default constructor 2.perameteralize consctructor

    Default constructor same as name of class and parameterised constructor.

    Instance constructor [Multiple Instances] & Non instance constructor

    1.Instance constructor 2.Non instance constructor

    5 Types of constructor are there 1)Default 2)Parameterised 3)Private Constructor 4)Copy Constructor 5)Static Constructor.

    Static Constructor Instance Constructor

    Basically there are five types of constructor are available in c#. 1) Default constructor 2) Parameter constructor 3) Copy constructor 4) Static constructor 5) Private constructor

    check this http://www.c-sharpcorner.com/UploadFile/0c1bb2/constructors-and-its-types-in-C-Sharp/

    Static Constructor Instance Constructor

    constructor are two types1. Instance Constructor This will fire when any object will be created. It can be parameter or parameterized constructor. 2. Static Constructor This will be fire first time when any member of class will be accessed. Like before object creation or static method call.

    Types of ConstructorsBasically constructors are 5 types those are1. Default Constructor2. Parameterized Constructor3. Copy Constructor4. Static Constructor5. Private Constructor Plz refer this link for detail. http://www.c-sharpcorner.com/UploadFile/0c1bb2/constructors-and-its-types-in-C-Sharp/ http://www.aspdotnet-suresh.com/2013/09/csharp-constructor-example-types-of-constructor-in-csharp.html