Number of questions 1,751
Number of tests completed 252,495
Number of questions answered 3,765,643
Number of registered users 19,174
Sign In | Register
Skip Navigation Links
Question: You are creating a class that uses a lot of system resources. When you use objects of this class, you want to be able to free these resources as soon as you're done using the object. What do you do?
Answer1: Write a destructor
Answer2: Write a method void CleanUp() that the user can call when he is done with the object
Answer3: Implement IDisposable
Answer4: Implement IConvertible
Answer: Implement IDisposable

Explaination: IDisposable is the way to go. You dispose of the object by calling its Dispose method or by wrapping it in a using code block.
Link: External Explaination

Correctly answered: 4143
Incorrectly answered: 2167
Terms of Use Ver. 2.0.6783.38332