Constructor

State the concept of constructor?

E

Expert

Verified

Constructor is a special method of class that is called automatically whenever the instance of the class is created. It is created having same name as the name of the class and assigns all class members, whenever the class member is accessed.

The main features of a constructor are as follows:

a) Constructors are always public.

b) Constructors do not have any return type.

c) It is not mandatory to declare constructor; it is invoked automatically by .NET Framework.

   Related Questions in DOT NET Programming

©TutorsGlobe All rights reserved 2022-2023.