destructor Vs finalize ()

The finalize () corresponds to the .Net Framework and is part of the System.Object class. Destructors are C#'s implementation of finalize () method. The functionality of both finalize () and the destructor is the same, i.e., they contain code for freeing the resources when the object is about to be garbage collected. In C#, destructors are converted to the finalize () method when the program is compiled. The finalize () method is called by the .Net Runtime and we can not predict when it will be called. It is guaranteed to be called when there is no reference pointing to the object and the object is about to be garbage collected.

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger