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

Whats new features in Visual Studio 2012?

975


What is password attribute of the textbox control of .net mobile? : Microsoft dot net mobile

934


Define cache coherency? : Dot net architecture

994


Describe the advantages of writing a managed code application instead of unmanaged one. What is involved in certain piece of code being managed?

1022


what is tracing? Where it used?

1104


What is WPF and WCF?

1010


Explain domestic architecture artifacts? : .NET Architecture

941


What are public and private assemblies ?

950


The maximum report processing jobs limit configured by your system administrator has been reached.How I can Solve this problem when i using crystal report to load from my application.

15052


What is a service class?

1009


How is the using() pattern useful? What is idisposable?

953


What is a managed code? : Dot net architecture

970


Define a managed code? : Dot net architecture

946


Explain the race around condition? : .NET Architecture

1013


What is .net mobile lists. Explain with an example? : Microsoft dot net mobile

897