static void Main(string[] args) { Car myNewCar = new Car(); myNewCar.Make = "BMW"; myNewCar.Model = "745li"; myNewCar.Color = "Black"; myNewCar.Year = 2005; Truck myTruck = new Truck(); myTruck.Make = "Ford"; myTruck.Model = "F950"; myTruck.Year = 2006; myTruck.Color = "Black"; myTruck.TowingCapacity = 1200; // someMethod(myNewCar); // someMethod(myTruck); myNewCar.PrintMe(); myTruck.PrintMe(); Console.ReadLine(); }
private static void someMethod(Car car) { Console.WriteLine("From someMethod: {0}",car.Make); }