예제 #1
0
        static void Main(string[] args)
        {
            Car myCar = new Car();
            myCar.Make = "BMW";
            myCar.Model = "745li";
            myCar.Colour = "Black";
            myCar.Year = 2005;

            printCarDetails(myCar);

            Truck myTruck = new Truck();

            myTruck.Make = "Ford";
            myTruck.Model = "F950";
            myTruck.Year = 2006;
            myTruck.Colour = "Black";
            myTruck.TowingCapacity = 1200;

            printCarDetails(myTruck);

            Console.ReadLine();
        }
예제 #2
0
 private static void printCarDetails(Car car)
 {
     Console.WriteLine("Here are the Car's details: {0}",
         car.FormatMe());
 }