Cannot overload the Finalize() method, why ?
Hi all,
Why can't the methode Finalize() from the System.Object be overloaded by
a child class. The compiler forces me to write a destructor instead. I
don't mind but why include a Finalize() method if we cannot do anything with
it ?
Also, which function get called first, Finalize() or the destructor ? I'm
betting Finalize() and then the destructor but I was just curious.
Thanks,
Louis-Philippe
Re: Cannot overload the Finalize() method, why ?
Louis-Philippe,
>Why can't the methode Finalize() from the System.Object be overloaded by
>a child class. The compiler forces me to write a destructor instead. I
>don't mind but why include a Finalize() method if we cannot do anything with
>it ?
It's the same thing. When you add a "destructor" to a C# class, you
actually do override Finalize. It's just hidden from you using this
special syntax.
Mattias
===
Mattias Sjögren (VB MVP)
mattias @ mvps.org
http://www.msjogren.net/dotnet/