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 msil in c#?

546


What are different types of Delegates in C#?

561


Can destructors have access modifiers?

562


Why we use dll in c#?

539


What is interface c#?

453






What is indexer c#?

465


Can int be null in c#?

498


Is post back c#?

493


Why are mutable structs evil?

539


What is jagged array?

540


What is namespace explain with example?

454


Why are strings in c# immutable?

493


What is generic method in c#?

486


What is a custom attribute?

475


Is there throws keyword in c#?

486