How can you clean up objects holding resources from within
the code?

Answers were Sorted based on User's Feedback



How can you clean up objects holding resources from within the code?..

Answer / 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

How can you clean up objects holding resources from within the code?..

Answer / kishore anumala

To clean up objects holding resources is to make use of
Dispose Method.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is the full form of GAC? Explain its uses?

0 Answers   PUCIT,


Is php better than c#?

0 Answers  


What are the collection classes ?

2 Answers   Digital GlobalSoft,


How do I create a .exe file?

0 Answers  


How to call a function when a class implements 2 interfaces and function is present in both interfaces?

2 Answers  


Is c# int immutable?

0 Answers  


Why should you override the tostring() method?

0 Answers  


What is the difference between Java and .NET garbage collectors?

0 Answers   BirlaSoft,


What is void in c#?

0 Answers  


Is c# 8 released?

0 Answers  


Int map to which .net types?

0 Answers  


What?s an abstract class?

5 Answers   Siebel,


Categories