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

Answers were Sorted based on User's Feedback



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

Answer / nishant

To Release the Memory Occupied by Object by implicit way
then use finalize() Method...And release the Memory by
Explicit Way then Use dispose() Method..

Is This Answer Correct ?    0 Yes 0 No

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

Answer / 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

More ASP.NET Interview Questions

How to implement caching?

2 Answers   Infosys, Microsoft,


What is route in web api?

0 Answers  


Is overloading possible in web services?

2 Answers   Microsoft,


Explain ViewState?

0 Answers   QuestPond,


What is session and cookies in asp.net?

0 Answers  






Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?

0 Answers  


What is the purpose of master page?

0 Answers  


What is interval time of GC in .net

2 Answers  


What is asp.net version?

0 Answers  


Explain the difference between overriding and overloading?

0 Answers  


Does JITting occur per-assembly or per-method? How does this affect the working set?

1 Answers  


what is roles in asp.net

2 Answers  


Categories