Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Microsoft Certified Solutions Developer (MCSD) Exam with comprehensive quizzes, flashcards, and multiple-choice questions. Each query includes hints and clear explanations to help you succeed. Get exam-ready today!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which resources are cleaned up by a Finalizer?

  1. Managed resources

  2. Unmanaged resources

  3. Temporary variables

  4. Global variables

The correct answer is: Unmanaged resources

The correct answer pertains to the role that a Finalizer plays in resource management, specifically in garbage collection within the .NET framework. A Finalizer, implemented in a class, is used to clean up unmanaged resources when an object is no longer in use. Unmanaged resources include things like file handles, database connections, and network connections, which are not directly managed by the .NET garbage collector. When an object with a Finalizer becomes eligible for garbage collection, the Finalizer is called before the object's memory is reclaimed. This gives the class an opportunity to release any unmanaged resources it holds, ensuring that there are no memory leaks or resource exhaustion in the application. Managed resources, on the other hand, are automatically handled by the .NET garbage collector and do not require a Finalizer for cleanup. Temporary variables and global variables also fall within the realm of managed resources and are not directly related to the responsibility of a Finalizer. Thus, focusing on the purpose of the Finalizer clearly establishes that its primary function is to handle the cleanup of unmanaged resources.