using System;
public class Program
{
struct Cat
string Name;
public Cat(string n): this ()
Name = n;
}
public override string ToString()
return Name;
struct Dog
public Dog(string n): this ()
public static void Main(string[] args)
var objs = new object[]
new Cat("Garfield"),
new Dog("Odie")
};
foreach (var obj in objs)
Console.WriteLine(obj.ToString());