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 use of console readkey ()?
Can you explain template pattern?
What is .edmx file?
What is scope c#?
Explain About Virtual functions and their use.
Is class reference type c#?
What are concrete classes?
How is a loop recorder monitored?
Is c# good for beginners?
Is arraylist thread safe?
Can fields inside a class be virtual?
What is private void in c#?
Can abstract class have constructor in c#?
Which of these string definitions will prevent escaping on backslashes in c#?
What is the default value of date?