Explain constructor.

Answers were Sorted based on User's Feedback



Explain constructor...

Answer / hafiza khan

Constructor is like a method with a same name as of ur
class name ,no return type..
It is used to initialize the memebr variables of the class..
If there is no contructor provided compiler invokes the
default constructor. the Moment there is contructor is
provided to the class it can be any either default or
parameterized the compiler stops invoking it own default
constructor

Is This Answer Correct ?    12 Yes 0 No

Explain constructor...

Answer / 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

More Dot Net General Interview Questions

What versions of .net are there?

0 Answers  


How to store and retrieve images in SQL server database through VB.NET?

1 Answers  


What is shared and repeatable inheritance?

0 Answers  


Can we have same method with same name and signature using partial classes

1 Answers  


How to Exchange data between Webservices

2 Answers  






What is namespace in .net?

0 Answers  


How will you load dynamic assembly? How will create assemblies at run time?

0 Answers   InfoAxon Technologies,


WHAT IS .net

3 Answers  


What are the different parts of an Assembly in .Net?

1 Answers  


What is use of ContextUtil class?

1 Answers  


Please explain what is the difference between encrypting a password and applying a hashing?

0 Answers  


As you know read-only variables and constants have many similarities, but what is at least one way that they differ?

0 Answers  


Categories