-
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/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|