예제 #1
0
        static void Main()
        {
            ICar car = new Benz();

            car.Break();
            car.Engine();


            car = new Toyota();
            car.Break();
            car.Engine();

            car = new Maruti();
            car.Break();
            car.Engine();

            Benz Bcar = new Benz();

            Bcar.BenzFunctionality();

            Toyota Tcar = new Toyota();

            Tcar.ToyotaFunctionality();

            Console.Read();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Maruti   obj1 = new Maruti("abc", "petrol", "123");
            Mahindra obj2 = new Mahindra("pqr", "disel", "456");

            Console.ReadKey();
        }
예제 #3
0
        static void Main(string[] args)
        {
            // Car car = new Car();
            Maruti   maruti   = new Maruti("petrol", "1", "maruti");
            Mahindra mahindra = new Mahindra("diesel", "2", "mahindra");

            Console.ReadKey();
        }
예제 #4
0
        public static void Main(string[] args)
        {
            Maruti myCar = new Maruti();

            myCar.model   = "Alto";
            myCar.color   = "White";
            myCar.price   = 10000000;
            myCar.mileage = 22.5f;
            myCar.PrintCarInformation();
            myCar.printMileage();
            Console.ReadLine();
        }