Difference between Dispose and Finalize method

Answer Posted / kirti

Finalize method is used to free the memory used by some unmanaged resources like window handles (HWND). It's similar to the destructor syntax in C#. The GC calls this method when it founds no more references to the object. But, In some cases we may need release the memory used by the resources explicitely.To release the memory explicitly we need to implement the Dispose method of IDisposable interface.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When will the .net framework 3.0 be released?

722


What are Model Binders in ASP.Net MVC?

876


What is Separation of Concerns in ASP.NET ASP.Net MVC?

817


Explain the use of Inversion of control (IOC)?

800


Briefly describe the roles of clr in .net framework?

736


Define the core components of an ASP.NET MVC application?

792


What is tempdata?

807


How we can add the CSS in ASP.Net MVC?

785


Can I remove .net framework?

761


Mention what is the difference between “ActionResult” and “ViewResult” ?

807


Describe the gac in the .net framework.

786


How to change the action name in ASP.Net MVC?

794


What is entity framework? : Entity framework

762


What is a model in programming?

751


Explain RenderBody and RenderPage in ASP.Net MVC?

806