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...

Does c# supports destructors?

Answer Posted / praveen saxena

Yes and No,
C# supports destructors just to provide a familiar way fo
destructing objects for C++ developers. even syntax also is
same but internally its the dicpose method that does all
the work.

Even if you declare a destructor the compiler automatically
translates a destructor into an override of the
Object.Finalize() method. In other words, the compiler
translates the following destructor:

class Class1
{
~Class1(){}
}

Into the following code:

class Class1
{
Protected override void Finalize()
{
try{..}
finally { base.Finalize();}
}
}

I guess that makes things more clear.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of console readkey ()?

1016


Can you explain template pattern?

1044


What is .edmx file?

993


What is scope c#?

878


Explain About Virtual functions and their use.

1032


Is class reference type c#?

924


What are concrete classes?

892


How is a loop recorder monitored?

930


Is c# good for beginners?

897


Is arraylist thread safe?

889


Can fields inside a class be virtual?

975


What is private void in c#?

923


Can abstract class have constructor in c#?

937


Which of these string definitions will prevent escaping on backslashes in c#?

1013


What is the default value of date?

944