What is the Difference B/W Finalize() and Dispose() in .Net?
Answer Posted / purushottam kumar, mcad, mcsd
Finalize :
1.Finalize() is called by the runtime
2.Is a destructor, called by Garbage Collector when the
object goes out of scope.
3.Implement it when you have unmanaged resources in your
code, and want to make sure that these resources are freed
when the Garbage collection happens.
Dispose :
1.Dispose() is called by the user
2.Same purpose as finalize, to free unmanaged resources.
However, implement this when you are writing a custom class,
that will be used by other users.
3.Overriding Dispose() provides a way for the user code to
free the unmanaged objects in your custom class.
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
To bind columns manually which tags do you need to add within the asp:datagrid ?
What is caching in asp.net?
Explain about the Class view window?
By default, Web API sends HTTP response with which of the following status code for all uncaught exception?
can any one find and tell the difference between dot net and php which one is best ? which one we get more salary? which one is stable and which one is best for freshers and also better in future and carrer ? which one we wil get more salary sir ? please send ur valuable suggestions to kiranpulsar2007@gmail.com
Why do I get error message "could not load type" whenever I browse to my asp.net web site?
What is IPostBack? How to use it?
Explain parts of assembly?
What is the difference between client-side and server-side validations in ASP.NET?
What do you mean by caching in asp.net?
What is difference between asp.net and asp.net mvc? : Asp.Net MVC
What is the difference between custom web user control and a custom web server control?
Can you explain one critical mapping?
What are the merits and demerits of viewstate?
What is server infrastructure?