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

What is Flyout Design Pattern in .NET?

642


Is .net core managed code?

527


What's the problem with .net generics?

564


How big is the datatype int in .net?

571


What is the difference between a namespace and assembly name in .net?

524






Is .net 4.8 backwards compatible?

551


Explain something about WebService?

681


What class does icon derive from? Isn't it just a bitmap with a wrapper name around it?

567


Differentiate between 'DataSet' and 'SQLDataReader' in ADO.NET?

597


Explain how do assemblies find each other?

583


Write a program to create a user control with name and surname as data members and login as method and also the code to call it.

528


How can you turn-on and turn-off cas?

554


Is there any attempt system for microsoft technology papers?

1299


What is an anonymous method and how is it different from a lambda expression?

525


Is .net core stable?

497