|
Subject:
|
Vb.net 2003
|
|
Posted By:
|
Kirti.darji
|
Post Date:
|
7/6/2006 8:20:19 AM
|
Hi Am kirti
I Understand One thing that despose And Finalize Method in .net But When They Use In Coding How Can We Get Idea This Time Use Despose() And This Time Finalize
Thank In Advance
|
|
Reply By:
|
Unna
|
Reply Date:
|
8/18/2006 11:12:13 AM
|
Kirti,
As per MSDN help file this is the difference:
Dispose Some objects support a method named Dispose whose purpose is to release system resources more expeditiously. Classes that support the Dispose method should implement the IDisposable interface. The Dispose method needs to be explicitly called when you want to release object resources. For example:
ThisObject.Dispose
Finalize Another method supported by some classes, Finalize, runs automatically when an object is released and can be used to perform other cleanup tasks. The Finalize method is similar to the Class_Terminate() method used in previous versions of Microsoft Visual Basic. Unlike the Dispose method, the CLR automatically calls the Finalize method sometime after an object is no longer needed.
|