- A garbage collector can reclaim memory for unmanaged resources used in C# code.
- True
- False
- Which of the following can be used to make sure the Finalize method is not called?
- GC.Collect();
- GC.SupressFinalize(this);
- GC.WaitForPendingFinalizers();
- None of these
3. Which one of the following statements is incorrect?
-
- Finalize can lead to performance implications due to the object remaining in memory longer than required.
- Generation 0 is used to save objects that are short-lived.
- Even if we use the IDisposable interface, we will not be able to suppress the calls that the garbage collector performs to execute the code in the Finalize method.
- The using block ensures that the Dispose method is called by the garbage collector automatically.