Answer Posted / vaidyanathan
By Dispose() method the object is marked for garbage
collection. But user can define a Dispose() method
identified by GC, only when the user implements the
IDisposable interface in the class. Once the dispose()
marks the object for deletion, the garbage collector, in
its subsequent collection cycle, collects the objects by
calling the respective Finalize() methods. So there is no
need for the user to write the Finalize() method. This is
the normal Process of Garbage collection.
At extreme cases user can force the garbage collection at a
specific time by calling GC.Collect() method. This should
be followed by GC.SuppressFinalize() method call to avoid
GC from calling Finalize() method on the same object once
again.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is CLR and its application.?
What Is The Smallest Unit Of Execution In .net?
What is managed code?
What is difference between new and override in c#?
Is struct object oriented?
What is private protected in c#?
Why do we use anonymous method in c#?
What are the 3 logical operators?
Is dictionary a collection?
What is dbcontext c#?
Can abstract class have constructor in c#?
What will be the output of the following code?
What is difference between var dynamic and object in c#?
What are the different types of literals in c#?
What is a copy constructor in c#?