Sunday 26 July 2015

what is constructor in .net

 Constructor :   Constructor was special method present in every class responsible for initializing the variables of a class. the name of a constructor method is same as class name. A constructor  method was non-value returning method. Every class requires a constructor . If at all it has to execute.

Syntax:
            [ <Modifiers>] <name>([<param def's>])
{
statements
}

Constructors are two types :
  1. Default Zero argument constructor.
  2. Parameterized constructor.

No comments:

Post a Comment