Explain constructor.

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to implement datagrid in.net? How would you make a combo-box appear in one column of a datagrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for datagrid methods. What is the access specifier used for that methods in the code behind file and why?

550


When displaying fonts, what is the difference between pixels, points and ems?

562


What is 'Common Type System' (CTS) in .NET?

655


Explain the difference between the stack and the heap?

538


what is dotnet architecture? can anyone explain that.

3612






What's wrong with a line like this? Datetime.parse(mystring);

565


Can "this" be used within a static method?

574


Differences between datagrid, datalist and repeater in .net?

535


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

530


What is the difference between response.redirect & server.transfer?

548


I want to serialize instances of my class. Should I use xmlserializer, soapformatter or binaryformatter?

543


Tell me what is serialization?

561


Explain me difference between public and static modifiers?

520


What is "common language runtime" (clr) in .net?

599


Do you know what's the difference between .net and laravel?

559