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
How main method is called in c#?
Why do we use struct in c#?
Whats an assembly? Describe the importance of assembly?
When should we use delegates in c#?
What is monitor in C#?
What is dataview c#?
What is entity framework c#?
What is the difference between Java and .NET garbage collectors?
Give an example to show for hiding base class methods?
What are c# i/o classes?
What is a private class in c#?
What is difference between dictionary and list in c#?
What are the uses of delegates in c#?
How are delegates chosen?
What is .cshtml file?