示例#1
0
        public static void Main()
        {
            var  driverName = Console.ReadLine();
            ICar ferarri    = new Ferrari(driverName);

            Console.WriteLine(ferarri);

            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");
            }
        }
示例#2
0
        public static void Main()
        {
            string driverName = Console.ReadLine();


            ICar car = new Ferrari(driverName, "488-Spider");

            Console.Write($"{car.model}/");
            car.Brakes();
            Console.Write("/");
            car.Gas();
            Console.Write("/" + car.driverName);
            Console.WriteLine();

            string ferrariName = typeof(Ferrari).Name;

            string iCarInterfaceName = typeof(ICar).Name;
        }
示例#3
0
        static void Main(string[] args)
        {
            var ferrari = new Ferrari(Console.ReadLine());

            Console.WriteLine(ferrari);
        }
示例#4
0
        static void Main(string[] args)
        {
            string driver = Console.ReadLine();

            Ferrari ferrari = new Ferrari(driver);
        }
示例#5
0
        static void Main(string[] args)
        {
            ICar driver = new Ferrari("George");

            Console.WriteLine(driver.ToString());
        }
        public static void Main()
        {
            IFerrari ferrari = new Ferrari(Console.ReadLine());

            Console.WriteLine(ferrari);
        }