Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what are constructors and destructors

Answer Posted / dsr

A constructor is a method, which is called when an object
of a class type is constructed, and it usually used for
initialization. A constructor method has following
characteristics:

It has the same name as class

It has no return type

It does not return any value

Constructors are always public and we use them to
initialize variable.

There is default class constructor without parameter,
provided by C# internally if we did not write any
constructor. when ever compile that class,compiler create
the default constructor(with out parameters).

In the other hand a Destructor is also called a finalizer.
It is just opposite the constructor, it is a method called
when the garbage collector reclaims an object.

Constructors have following characteristics:

The name of a destructor is same as name of class

The destructor declared with a tilde (~).

Destructors are always public and never other than public.

Destructors take no arguments. So, there is only one
destructor per class.

Destructors have no return type.

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is inheritancy where u required ?

1991


What is the difference between l1 and l2 cache? : Dot net architecture

948


Explain dotnet framework ?

1036


Explain different pipelining hazards and how are they eliminated? : .NET Architecture

1010


What happens to the winfx technologies?

1008


What is the difference between metadata and menifest ?

917


deference between display and visibility property of CSS

2279


Explain the race around condition? : .NET Architecture

1012


8. Oop-Why and were we use Interfacse and Abstract class.

2142


Do you know textbox and textview controls of .net mobile? : Microsoft dot net mobile

1028


How do I prevent concurrent access to my data?

1032


Define an interrupt? : Dot net architecture

976


Explain domestic architecture artifacts? : .NET Architecture

939


Explain element .net mobile with example? : Microsoft dot net mobile

983


How to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile

939