How can you clean up objects holding resources from within
the code?
Answers were Sorted based on User's Feedback
The recommended practice is to implement both Finalize as
well as Dispose methods on an object which needs to clean up
unmanaged resources. The Finalize method would serve as a
backup mechanism in the event that the Dispose is never
called. The garbage collector would perform the object
finalization and prevent a permanent leak of the unmanaged
resource.
Is This Answer Correct ? | 4 Yes | 0 No |
To clean up objects holding resources is to make use of
Dispose Method.
Is This Answer Correct ? | 1 Yes | 0 No |
Is list passed by reference c#?
Can a class or a struct have multiple constructors?
What is Co- and Contra-Variance in C#?
Define delegate in c#?
What is the difference between static class and singleton class in c#?
how to access the virtual method without creating the objet for the virtual method?
Explain the difference between user control and custom control. Also, explain their use.
Are there constructors in c sharp?
Why do we need to override in c#?
Can a dictionary have the same key?
what is serilization?
Write down the c# syntax to catch an exception