How can you clean up objects holding resources from within
the code?
Answer Posted / nagasaichand
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 |
Post New Answer View All Answers
What are the differences between value types and reference types?
Explain the constructor in c#.
Are enums static c#?
Why attributes are used in c#?
Explain the mechanism of VB.NET/C# achieve polymorphism?
What does convert toint32 mean?
What is namespace explain with example?
What is difference between dictionary and list in c#?
What is disco?
Explain streamreader/streamwriter class?
What is the implicit name and type of the parameter that gets passed into the class set method?
What is the difference between wrapper class and primitive?
We cannot create instances of static classes. Can we have constructors for static classes?
What do you mean by delegates and explain different types of delegates?
What are the three types of operators?