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?

Answers were Sorted based on User's Feedback



Does c# supports destructors?..

Answer / 'tiger' senthil

yes,C# allows destructor.

Is This Answer Correct ?    8 Yes 0 No

Does c# supports destructors?..

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

Does c# supports destructors?..

Answer / k. amith kumar

Yes

Example:
class A
{
A(){} //Constructor.
~A(){} //Distructor.
.........
..........
}

Is This Answer Correct ?    5 Yes 1 No

Does c# supports destructors?..

Answer / vijay

yes.

when a objects created by Constructor are removed by
destructor

Is This Answer Correct ?    2 Yes 0 No

Does c# supports destructors?..

Answer / puneet

Desturctors are very much supported by c#. Internally a c#
destructor is converted to a finalize method call.

Is This Answer Correct ?    2 Yes 1 No

Does c# supports destructors?..

Answer / chinju

yes c# support destructor.it is used to delete object
explicitly.Dispose() is used for this.if we didn't write the
destructor explicitly it will call the default destructor ie
Finalize().always destructor is executed after the execution
of name space

Is This Answer Correct ?    1 Yes 0 No

Does c# supports destructors?..

Answer / mahesh

No, I didnt think distructor is supported by C# as far as
dispose() is concern it is used for clean up code like
finalize the object is distroyed automatically by garbage
collector

Is This Answer Correct ?    2 Yes 2 No

Does c# supports destructors?..

Answer / kamlesh sharma

yes c# allow destructures

Is This Answer Correct ?    1 Yes 1 No

Does c# supports destructors?..

Answer / ashish gupta

i think it doesnt allow to use Destructor.

there is a method called Dispose() which automatically
calls destructor

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More C Sharp Interview Questions

What C# keyword class access modifier specifies that the class is concrete and CANNOT be derived from?

3 Answers  


What is difference between the "throw" and "throw ex" in .net?

0 Answers  


what is the lifespan of the items stored in viewstate ?

4 Answers  


What are classes in c#?

0 Answers  


What is overloading in c#?

0 Answers  


Explain about Error handling and how this is done

0 Answers   Digital GlobalSoft,


How to make sure custom class supports deterministic finalization?

1 Answers   IBM,


Why do we need static in c#?

0 Answers  


I wish to create a windows application to perform a similar function as that of the "Search" which is provided to look for related files and folders in the System.. What steps must i follow??

0 Answers  


What is getenumerator?

0 Answers  


What is a Assembly?

0 Answers   UGC Corporation,


What is a interface in c#?

0 Answers  


Categories