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
How can you sort strings in array that are passed to method as arguments?
What is arraylist class in c#?
Name some string escape sequences in c#.
what is IFormatable
What are the advantages of interface in c#?
Differentiate between static class and singleton instance?
What is difference between iqueryable and ienumerable in c#?
Can we extend static class in c#?
Why data types are important in c#?
If I want to override a method one of class A and in class b then how do you declare?
What are accessors?
What is the usage of transponders?
What is int64 in c#?
What is the .net datatype that allows the retrieval of data by a unique key?
The int maps to which C# keyword in .NET type?