state the differences between the dispose and


State the differences between the Dispose () and Finalize().

CLR uses the Dispose and Finalize methods to perform garbage collection of run-time objects of .NET applications.

The Finalize method is called automatically by the runtime. CLR has a garbage collector (GC), which periodically checks for objects in heap that are no longer referenced by any object or program. It calls the Finalize method to free the memory used by such objects. The Dispose method is called by the programmer. Dispose is another method to release the memory used by an object. The Dispose method needs to be explicitly called in code to dereference an object from the heap. The Dispose method can be invoked only by the classes that execute the IDisposable interface.

 

Request for Solution File

Ask an Expert for Answer!!
DOT NET Programming: state the differences between the dispose and
Reference No:- TGS0310694

Expected delivery within 24 Hours