What is the Difference B/W Finalize() and Dispose() in .Net?
Answers were Sorted based on User's Feedback
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 |
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 |
How to implement caching?
What is route in web api?
Is overloading possible in web services?
Explain ViewState?
What is session and cookies in asp.net?
Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?
What is the purpose of master page?
What is interval time of GC in .net
What is asp.net version?
Explain the difference between overriding and overloading?
Does JITting occur per-assembly or per-method? How does this affect the working set?
what is roles in asp.net