Explain the difference between dispose and finalize()?



Explain the difference between dispose and finalize()?..

Answer / Kushal Kumar

In .NET, Dispose is a method that developers can call to release resources such as memory or file handles that their objects are using. This is typically done in the 'using' statement. Finalize is a method that the .NET runtime calls when an object is garbage collected. The Finalize method allows objects to perform any necessary cleanup tasks before they are destroyed. However, finalization is slower than disposal because it requires the object to be garbage collected first. Additionally, calling Dispose manually ensures that resources are released promptly, while relying on finalization means there may be a delay.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB.NET Interview Questions

What are the differences between vb.net and c#, related to oops concepts

1 Answers  


Define naming convention?

1 Answers  


Explain about visual basic?

1 Answers  


Explain i.tostring method?

1 Answers  


Explain an assembly and its use?

1 Answers  


sir i want to ask you that how can i fetch or get sql data into texboxes.where i want to show record in specific texboxes related to student information.when i click on button all data show on texboxes when i put id or name plz inform me on my id

1 Answers  


What is the difference between readonly variable and constant variable?

1 Answers  


What is the difference between manifest and metadata?

1 Answers  


What is the purpose of an Assembly?

1 Answers  


Explain jagged array in vb.net?

1 Answers  


What is an abstract class?

4 Answers  


What is the Difference between Overriding and overloading?

31 Answers   Subex, TCS,


Categories