Explain constructor.

Answer Posted / megha

Constructor is a method having same name as that of a
class.It is automatically invoked when an object is
created.It is used to Initialize variables of a class.It has
no return types.
3 types of constructors are:-
1)default constructor
2)parameterised constructor
3)static constructor

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Please explain what is heap and what is stack?

781


Do I have any control over the garbage collection algorithm?

808


What is alias ? Is it used in .Net ?

858


What tags do you need to add within the asp:datagrid tags to bind columns manually.

1693


Explain security measures exist for .net remoting in system.runtime.remoting?

805


Do you know what is lambda expressions in c#?

768


What is dot net and its uses?

771


what is machine key error in .NET how can we solve it?

2340


What is garbage collection and how it works ?

832


How to view a .NET assembly?

818


What is heap and what is stack?

814


What's the use of system.diagnostics.process class in .net?

817


Where does the gac exist ?

777


What is RPC? What is the use of it?

825


What is "microsoft intermediate language" (msil)?

771