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

Why would you use untrusted verification?

0 Answers  


What is the difference between out and ref in c#?

0 Answers  


what are wrapper classes?

1 Answers  


What do you mean by thread safe in c#?

0 Answers  


What exactly is serverless?

0 Answers  






What is expression tree with example?

0 Answers  


What is singleordefault?

0 Answers  


what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?

0 Answers   CTS,


What are native functions?

0 Answers  


What is the use of regex in c#?

0 Answers  


What?s the implicit name of the parameter that gets passed into the class? set method?

3 Answers   Visual Soft,


How to use exception handling in stored procedure?

0 Answers   Wipro,


Categories