Example #1
0
        public static void Main()
        {
            ICar car = new Ferrari(Console.ReadLine());

            Console.WriteLine(car);

            string ferrariName       = typeof(Ferrari).Name;
            string iCarInterfaceName = typeof(ICar).Name;

            bool isCreated = typeof(ICar).IsInterface;

            if (!isCreated)
            {
                throw new Exception("No interface ICar was created");
            }
        }
Example #2
0
        public static void Main()
        {
            var driver  = Console.ReadLine();
            var ferrari = new Ferrari(driver);

            Console.WriteLine(ferrari.ToString());

            var ferrariName       = typeof(Ferrari).Name;
            var iCarInterfaceName = typeof(ICar).Name;

            bool isCreated = typeof(ICar).IsInterface;

            if (!isCreated)
            {
                throw new Exception("No interface ICar was created");
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            string  driver = Console.ReadLine();
            Ferrari f      = new Ferrari(driver);

            Console.WriteLine(f);

            string ferrariName       = typeof(Ferrari).Name;
            string iCarInterfaceName = typeof(ICar).Name;

            bool isCreated = typeof(ICar).IsInterface;

            if (!isCreated)
            {
                throw new Exception("No interface ICar was created");
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            string  model      = "488-Spider";
            string  driverName = Console.ReadLine();
            Ferrari ferrari    = new Ferrari(model, driverName);

            Console.WriteLine(ferrari.ToString());

            string ferrariName       = typeof(Ferrari).Name;
            string iCarInterfaceName = typeof(ICar).Name;

            bool isCreated = typeof(ICar).IsInterface;

            if (!isCreated)
            {
                throw new Exception("No interface ICar was created");
            }
        }
Example #5
0
        public static void Main()
        {
            string ferrariName       = typeof(Ferrari).Name;
            string iCarInterfaceName = typeof(ICar).Name;

            bool isCreated = typeof(ICar).IsInterface;

            if (!isCreated)
            {
                throw new Exception("No interface ICar was created");
            }

            string driverName = Console.ReadLine();

            ICar someCar = new Ferrari(driverName);

            Console.WriteLine(someCar.ToString());
        }
Example #6
0
        static void Main(string[] args)
        {
            string  driverName = Console.ReadLine();
            Ferrari car        = new Ferrari(driverName);

            Console.Write($"{car.Model}/");
            car.Break();
            Console.Write("/");
            car.FullGas();
            Console.Write("/");
            Console.WriteLine($"{car.Name}");

            string ferrariName       = typeof(Ferrari).Name;
            string iCarInterfaceName = typeof(ICar).Name;

            bool isCreated = typeof(ICar).IsInterface;

            if (!isCreated)
            {
                throw new Exception("No interface ICar was created");
            }
        }
Example #7
0
        public static void Main()
        {
            Ferrari ferrari = new Ferrari(Console.ReadLine());

            Console.WriteLine(ferrari);
        }
Example #8
0
        static void Main(string[] args)
        {
            IDriveable car = new Ferrari(Console.ReadLine());

            Console.WriteLine(car.ToString());
        }