What is the Difference B/W Finalize() and Dispose() in .Net?

Answer Posted / sushma

A Dispose() method is explicit, meaning you code Dispose()
up and explicitly call it in your application or system
code. A Finalize() method is implicit, meaning you code
Finalize() up but never actually call it — Finalize() is
called behind the scenes by the .NET GC mechanism.

The GC call the Finalize() function automatically to destroy
the object called implicit destroy. when you want to destroy
a objects that you think no longer need and free it from
memory, then we will use the dispose function. For better
performance we will use the dispose function explicitly.

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different method of navigation in asp.net?

563


How do I use response redirect?

558


Explain what is an assembly?

554


Explain what are the advantages of asp.net mvc framework? : asp.net mvc

517


Explain the use of duration attribute of @outputcache page directive.

615






Can one dll file contains the compiled code of more than one .net language?

530


What is the life cycle of web page?

521


What are standard controls?

510


What are the versions of garbage collection?

1456


What language is asp.net written in?

526


How can you implement the postback property of an asp.net control?

527


Securitywise What are the Enhancements in 2.0?

1486


Explain the main function of url routing system in asp.net mvc? : asp.net mvc

490


How do you use viewstate?

552


How do you create a master page?

555