static void Main(string[] args) { CA a = new CA() { Name = "jack hello", Age = 18 }; CB b = new CB() { First = "kate", Second = "hi", PersonsAge = 21 }; PrintInfo(a); PrintInfo(b); }
static void Main(string[] args) { CA a = new CA() { Name = "jack", Age = 18 }; PrintInfo(a); }
static void PrintInfo(CA item) { Console.WriteLine("Name: {0}, Age: {1}", item.Name, item.Age); }