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 sorted list in c#?

0 Answers  


What is cshtml extension?

0 Answers  


What are the different types of literals in c#?

0 Answers  


what is the difference between the debug class and trace class?

0 Answers   Rolta,


Why to use lock statement in c#?

0 Answers  






Where are all .NET Collection classes located ?

8 Answers   TCS,


What are events in C#?

0 Answers   CDC,


What does the keyword “virtual” declare for a method or property?

0 Answers   Siebel,


Why abstraction is used in c#?

0 Answers  


How we free the memory in C#.NET.

3 Answers   Synechron,


What is literal control

0 Answers  


About delegates and events?

2 Answers   ADITI,


Categories