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 default value of decimal c#?

0 Answers  


Is int an object in c#?

0 Answers  


What is cosole application?

0 Answers  


What is a sealed class?

0 Answers  


Which of these string definitions will prevent escaping on backslashes in c#?

0 Answers  






List the difference between the virtual method and the abstract method?

0 Answers  


What is meant by desktop application?

0 Answers  


What is the difference between parse and tryparse in c#?

0 Answers  


What is difference between private and protected in c#?

0 Answers  


Explain the advantage of using system.text.stringbuilder over system.string?

0 Answers  


What are the string functions in c#?

0 Answers  


Is arraylist thread safe?

0 Answers  


Categories