A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

What is the difference between dispose and finalize methods in c#?
Q:

What is the difference between dispose and finalize methods in c#?

0

What is the difference between dispose and finalize methods in c#?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Dispose: This method uses interface – “IDisposable” interface & it will free up both managed and unmanaged codes like – database connection, files etc. It belongs to the IDisposable interface. Implement this method when you are writing a custom class that will be used by other users.

Finalize: This method is called internally unlike Dispose method which is called explicitly. It is called by the garbage collector and can’t be called from the code. Finalize belongs to System.Object class. Implement this method when you have unmanaged resources in your code, and make sure that these resources are freed when the Garbage collection happens.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now