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
In .NET how can you solve the DLL Hell problem?
Can a class or a struct have multiple constructors?
What is #region in c#?
What is the difference between const and static read-only?
What is the difference between method overriding and method overloading?
What is a variable in c#?
What is boolean conditions in c#?
Explain how do I convert a string to an int in c#?
What does the dispose method do with the connection object?
What is the use of console application in c#?
Is an array an object c#?
What does this keyword mean in c#?
Can an abstract class inherit from another abstract class c#?
Who benefits from ajax?
What is xor operator in c#?