What is the significance of Finalize method in .NET

Q

What is the significance of Finalize method in .NET?

✍: Guest

A

.NET Garbage collector does almost all clean up activity for your objects. But unmanaged resources (ex: - Windows API created objects, File, Database connection objects, COM objects etc) is outside the scope of .NET framework we have to explicitly clean our resources. For these types of objects .NET framework provides Object. Finalize method which can be overridden and clean up code for unmanaged resources can be put in this section.

2007-10-23, 7153👍, 0💬