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 is .net core used for?

0 Answers  


Why do we use msmq?

0 Answers  


Explain what is the difference between a class and an object?

0 Answers  


What is MSIL, IL, CTS?

3 Answers  


What are .net applications?

0 Answers  






Please explain what are an inheritance, polymorphism, and encapsulation?

0 Answers  


How is a property designated as read-only?

2 Answers   Siebel Systems,


What is the difference between encrypting a password and applying a hashing?

0 Answers  


Difference between VB.NET and C#. Which is faster ?

16 Answers   TCS,


What are Generics? Where do we use them.

2 Answers   Value Labs,


What is singleton activation mode in .net?

0 Answers  


How different are interface and abstract class in .Net?

2 Answers  


Categories