Explain constructor?

Answer Posted / pragnyan

Constructor is a method having the same name as the class
name.It is automatically invoked when instance of the class
is created.It is used to initialize the members.Constructos
canot have any return type not even void.constructors can
be overloaded.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is keywords in c#?

661


What is difference between private, protected, and public in C#?

762


Can a constructor be static in c#?

734


What is an argument in c#?

701


What is sorting in c#?

677


What is the usage of transponders?

709


What is a multicast c# delegate?

704


Why do we use public static void main in c#?

661


What is boxing? Explain its functionality?

727


Give an example to show for hiding base class methods?

622


Give examples for value types?

689


What do you mean by expression tree?

609


What is the delegate in c#?

664


What is the use of console?

658


How will you allow a class to be inherited, but prevent the method from being over-ridden?

701