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

Can we set which type of comparison we want to perform by the CompareValidator control?

528


How to do state management in ASP.NET?

609


What is the concept of view state in asp.net?

567


What is cache in asp net?

540


What are the advantages and disadvantages of Using Cookies?

525






What’s the catch?

630


Describe the Server Control Events of ASP.NET?

663


What is paging in context of Memory?

663


Can we add code files of different languages in app_code folder?

607


What is difference between viewstate and session in asp net?

568


What are the ways to sending the data in ASP.NET page?

573


1.can we add connection string in global.asax?????????? 2.what are the default files included when we create new web application????

18552


How can we identify that the Page is Post Back?

561


How many web config files can be created for an application?

458


What does mean by a neutral culture?

609