What is the difference between dispose() and finalize() methods in C#?

C# Programming Language >   OOPS Concept >   Introduction to OOP Concept  

Short Question

705


Answer:

The dispose() method is explicitly called by user to free unmanaged resources such as files, database connections etc whereas finalize() method is implicitly called by garbage collector to free unmanaged resources like files, database connections etc.

The dispose() method belongs to IDisposable interface whereas finalize() method belongs the Object class.


This Particular section is dedicated to Question & Answer only. If you want learn more about C# Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.