Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("Begin");
- var item = new Item();
- GC.Collect();
- GC.WaitForPendingFinalizers();
- Console.WriteLine("End");
- }
- }
- class Item: IDisposable
- {
- public void Dispose() => Console.WriteLine("Dispose");
- ~Item() => Console.WriteLine("Finalize");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment