Explain constructor in c#?

Answer Posted / hrpynux@gmail.com

A constructor in C++ is a special 'MEMBER FUNCTION' having the same name as that of its class which is used to initialize some valid values to the data members of an object. It is executed automatically whenever an object of a class is created

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of console readkey in c#?

665


Why main method is static in c#?

680


Why do I get an error (cs1006) when trying to declare a method without specifying a return type?

703


Is string nullable in c#?

665


What is out int in c#?

654


Why delegates are required?

706


What does the initial catalog parameter define in the connection string?

675


Why do we use delegates in c#?

673


Is datetime a value type in c#?

659


What is attribute and reflection in c#?

666


What is 8 bit signed integer?

644


What is a delegate how is it type safe?

649


What is the use of generics in c#?

629


Why do we need singleton class in c#?

711


How many variables do you need?

683