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 an anonymous method and how is it different from a lambda expression?

0 Answers  


What is the Difference between directcast and ctype?

3 Answers   Wipro,


what is managed data and managed code?

2 Answers  


What is func in .net 3.5?

0 Answers  


What is Global Assembly Cache (GAC) and what is the purpose of it?

2 Answers   Ksb,






Is .net core installed?

0 Answers  


Explain the difference between garbage collections in .net 4.0 and earlier versions?

0 Answers  


What?s a Windows process?

1 Answers  


How we can achieve Connection pooling in .Net?

0 Answers   PUCIT,


Write code for fetch record nos 15 to 25 from a dataset containing 50 records?

4 Answers   C Squared Systems,


What is JIT and how is works?

3 Answers  


Explain the .NET architecture.

9 Answers   HCL, Idhasoft, Scandent, TCS, TechnoLinks,


Categories