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

Where do we store our connection string in asp.net application?

0 Answers  


What is a page life cycle?

0 Answers  


What does aspnet_regiis -i do ?

1 Answers  


We are using Jscriopt validations and at clint site javascript is not running that time validation would work? if yes then how it would behave?

0 Answers  


What is user control in asp.net?

0 Answers  






What do you mean by query string?

0 Answers  


what is the difference between primary key and foreign key?

2 Answers  


How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode, but he is still not able to logon, what might be the possible cause for this? In ASP.Net application how do you find the name of the logged in person under windows authentication?

0 Answers  


What is state management in asp.net with example?

0 Answers  


What are custom controls?

0 Answers  


How we handle the runtime database schema change issue in asp.net application?

2 Answers   IBM, Tech Mahindra,


Difference Between ReadOnly and Constant Variable in compile time and Run Time.

3 Answers   Phoenix Technologies, Quadrant,


Categories