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 garbage collection? How to force garbage collector to run?

0 Answers  


what is serilization?

6 Answers   Protech,


Is it possible to implement an interface to a structure? Is it possible to extend a struct? Is it possible to inherit a class to struct?

9 Answers   IBM, Logica CMG, TCS,


What is a cshtml file?

0 Answers  


Can u create multiple threads of execution ?

1 Answers   IBM, ITC Infotech, UHU,






What do you mean by delegates and explain different types of delegates?

0 Answers  


Explain what is the smallest unit of execution in .net?

0 Answers  


What is the use of jit ? Jit (just - in - time) is a compiler which converts msil code to

0 Answers  


Can constructor have return type c#?

0 Answers  


Can you allow class to be inherited, but prevent the method from being over-ridden?

1 Answers  


FOR EXAMPLE : CLASS Dotnet { } creating object: Dotnet dn=new Dotnet(); NOW THE QUESTION IS WHICH IS CALLED AS OBJECT ?EITHER dn OR new Dotnet() and CAN YOU PROVE YOUR ANSWER?????PLEASE REPLY...

1 Answers  


What is parallel foreach in c#?

0 Answers  


Categories