Use of Finalize method in .NET:
.NET Garbage collector performs all the clean up activity of the managed objects or we can say GC call the Finalize () function automatically to destroy the object called implicit destroy., and so the finalize method is usually used to free up the unmanaged objects like File objects, Windows API objects, Database connection objects, COM objects etc.
Use of the dispose() method in .NET:
The Dispose method in .NET belongs to IDisposable interface and it is best used to release unmanaged objects like File objects, Windows API objects, Database connection objects, COM objects etc from the memory. For betterPerformance we will use the dispose function explicitly.
No comments:
Post a Comment