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

What is ispostback method in asp.net?

0 Answers  


How Session outproc in Sqlserver stored?

0 Answers   CGI,


Asp.Net Source :- In my project i have gridview control - item template. Its have asp:button control. my requirement is while click this button i need to display some alert message. Could you please help me which gridview event i need to write source code? Please give me a quick response. Thanks

6 Answers  


Distinguish between Server-side and Client-side code?

0 Answers   Siebel,


Why would anyone need to implement their own hashtable or linked list?

0 Answers  






How do we invoke queries from the application?

3 Answers   Microsoft,


Write a standard lock() plus double check to create a critical section around a variable access?

1 Answers  


What would be salary for 8+ years of experience in ASP.NET in different metro city in india?

0 Answers   Prompt Softech,


Differentiate session and cookie

1 Answers  


What r the remotable objects. and how u make an application remotable

1 Answers  


Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?

0 Answers  


Why should i prefer JSP over asp.net or any other web development language..??

0 Answers  


Categories