What is the use of finalize and dispose eventhough garbage
collector is working?
Answers were Sorted based on User's Feedback
Answer / chinmay shah
We can perform finalize opertaion Immediately after
completing the work and same with dispose also while in
case of garbage collector it will dispose the object, until
it feels they are not in use.
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / bharani
Finalize method is actually a the destructor for the
mananged objects, but if you want to destruct an unmanaged
object dispose method allows the programmer to make
explicit calls such as destroywindow to the destruct the
unmanaged object.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / chaitanya
It is advisable not to use the finalize and Dispose
methods,because garbage collector takes Care of the objects
that Should be Disposed.We should use Finalise and Dispose
methods when working with resources in the network or
working with the unmanaged code.
Is This Answer Correct ? | 3 Yes | 1 No |
What are Validation Annotations?
How OS come to know whether to load the .net framework when we run an .exe created using .Net framework?
What is the difference between viewbag and viewdata in mvc?
What's different about namespace declaration when comparing that to package declaration in Java ?
Is the lack of deterministic destruction in .NET a problem
What is ViewStart Page in ASP.Net MVC?
Explain the advantages of asp.net mvc over asp.net?
What is Attribute Routing in ASP.Net MVC?
Why should we go for entity framework?
What is meant by domain model?
What is difference between html.beginform and ajax.beginform?
Explain the use of Inversion of control (IOC)?