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 / ramesh

We can clean up object holding resources by using dispose()
method. Example
DataSet DS=new DataSet()

DS.Dispose()

Is This Answer Correct ?    5 Yes 1 No

How can you clean up objects holding resources from within the code? ..

Answer / mohan kumar e.

We can cleanup objects by implementing IDisposable
interface and providing the implementation for Dispose
method.

Is This Answer Correct ?    3 Yes 1 No

How can you clean up objects holding resources from within the code? ..

Answer / nagasaichand

2 PROCEDURES FORT THIS:
1)Make that value of object as null once the scope is finished.
2)use dispose(); method

Is This Answer Correct ?    1 Yes 0 No

How can you clean up objects holding resources from within the code? ..

Answer / tarun singla

Easiest way is to make the value of that object as null,
once the scope of that object is over. We generally do this
in the 'finally' section of the code.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can two catch blocks be executed?

13 Answers  


Define a class and an object?

1 Answers  


What is the minimum size (in bytes) of string data type in c#? Give its compatible data type in .NET Framework.

5 Answers  


C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?

3 Answers   Visual Soft,


What are the advantages of using c#?

1 Answers  


What is shared inheritance

3 Answers   IGT,


What is default class in c#?

1 Answers  


Is hashset serializable c#?

1 Answers  


What are the namespace level elements?

1 Answers  


Can you declare the override method static while the original method is non-static?

5 Answers  


I wish to create a windows application to perform a similar function as that of the "Search" which is provided to look for related files and folders in the System.. What steps must i follow??

1 Answers  


Can we inherit class that contains only one private constructor?

1 Answers  


Categories