using System;
public class Program
{
public static void Main()
/* Test();
void Test()
Person? tom = null;
try
tom = new Person("Tom");
}
finally
tom?.Dispose();
}*/
Person tom = new Person("Tom");
tom.Dispose();
public class Person : IDisposable
public string Name { get; }
public Person(string name) => Name = name;
public void Dispose()
Console.WriteLine($"{Name} has been disposed");