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

When static constructor is invoked?

9 Answers   TCS,


Is c# dictionary a hash table?

0 Answers  


What is the lock statement in c#?

0 Answers  


What is attribute c#?

0 Answers  


Is c# slower than java?

0 Answers  


What is difference between string and stringbuilder in c#?

0 Answers  


What are the applications of c#?

3 Answers  


How do I declare a pure virtual function in c#?

0 Answers  


How to achieve polymorphism in c#?

0 Answers  


Why is it a bad idea to throw your own exceptions?

1 Answers   Visual Soft,


What is delegate in c#?

0 Answers  


Explain the difference between const and static read-only?

0 Answers  


Categories