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
What is the difference between and xml documentation tag?
Define thread?
Is exe is machine dependent?
What are the different types of constructors in c#?
Define a strong name in .net?
What is object array in c#?
How many types of polymorphism are there?
What does the parsefloat function do?
What is marshalling and what are different kinds of marshalling?
Who benefits from ajax?
How many keyword present in C# language ?
What is gui in c#?
What is the difference between xml documentation tag?
How is a strongly-named assembly different from one that isn’t strongly-named?
Name the two classes are required for implementing a windows service?