CONSTRUCTORS IN C#

Posted on Updated on

Image result for C#CONSTRUCTORS IN C#

Whenever an instance of a class is created a constructor is called. A constructor is a special member function that is called automatically. It is basically used to initialize the private member variables of the class. If a constructor is not defined in the class, a default constructor is called automatically by the compiler. The default constructor initializes all the numeric values to zero and all strings and object fields to null.

Properties of Constructors

 A class can contain multiple number of constructors

 It doesnot have a return-type not even a void.

 Static constructor doesn’t contains a parameter.

 In a class only a single static constructor can be defined.

Types of constructor

 Default constructor

 Parameterized constructor

 Copy constructor

 Static constructor

 Private constructor

*****************************************************************************************************

For more details and queries please feel free to email, visit or call us. Wishing you the very best for all your future endeavors.
Helpline: 9814666333, 8699444666
Email: info@technocampus.co.in

Please fill the form and we shall contact you soon.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s