Qus:    What is the difference between dispose() and finalize()?
Oct 31, 2020 07:20 2 Answers Views: 675 SAI
Prev Next
Answers (2)
PADMAKEECHU Nov 01, 2020 22:46
Answer:   Although Dispose and Finalize both methods are used by CLR to perform garbage collection of runtime objects of .NET applications but there is a difference between them.
The Finalize method is called automatically by the runtime while the Dispose method is called by the programmer.

PARTH Nov 09, 2020 08:16
Answer:   Finalize is the backstop method, called by the garbage collector when it reclaims an object. Dispose is the "deterministic cleanup" method, called by applications to release valuable native resources (window handles, database connections, etc.) when they are no longer needed, rather than leaving them held indefinitely until the GC gets round to the object.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect