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

Is list passed by reference c#?

0 Answers  


Can a class or a struct have multiple constructors?

0 Answers  


What is Co- and Contra-Variance in C#?

0 Answers  


Define delegate in c#?

0 Answers  


What is the difference between static class and singleton class in c#?

0 Answers  






how to access the virtual method without creating the objet for the virtual method?

1 Answers  


Explain the difference between user control and custom control. Also, explain their use.

0 Answers   Accenture,


Are there constructors in c sharp?

0 Answers  


Why do we need to override in c#?

0 Answers  


Can a dictionary have the same key?

0 Answers  


what is serilization?

6 Answers   Protech,


Write down the c# syntax to catch an exception

0 Answers  


Categories