public static void Main()
object[] items = { new Book("The Tempest"), new Person("John") };
foreach (var item in items) {
Console.WriteLine($"Type: {obj.GetType().Name}, Value: {obj}");
Console.WriteLine($"{obj}");
public Book(string title)
public string Title { get; set; }
public override string ToString()
public Person(string name)
public override string ToString()