0% found this document useful (0 votes)
34 views1 page

Constructors in C#

Uploaded by

Madhuri Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Constructors in C#

Uploaded by

Madhuri Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CONSTRUCTORS IN C#

 A class constructor is a special member function of a class that is


executed whenever we create new objects of that class.
 A constructor has exactly the same name as that of class and it
does not have any return type.
Default Constructor
A constructor which has not defined any parameters or we can say
without any parameters is called default constructor. It initializes the
same value of every instance of class.
Parameterized Constructor
A constructor which has at least one parameter is called Parameterized
Constructor. Using this type of constructor we can initialize each
instance of the class to different values.

You might also like