Example #1
0
        static void Main()
        {
            string          driver  = Console.ReadLine();
            global::Ferrari ferrari = new global::Ferrari(driver);

            Console.WriteLine(ferrari);
        }
Example #2
0
        static void Main(string[] args)
        {
            string name = Console.ReadLine();

            var ferrari = new global::Ferrari(name);

            Console.WriteLine(ferrari);
        }
Example #3
0
        public static void Main()
        {
            bool isCreated = typeof(ICar).IsInterface;

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

            string driver = Console.ReadLine();

            ICar ferrari = new global::Ferrari(driver);

            Console.WriteLine(ferrari);
        }
        static void Main(string[] args)
        {
            ICar car = new global::Ferrari(Console.ReadLine());

            Console.WriteLine(car.ToString());

            string ferrariName       = typeof(global::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(global::Ferrari).Name;
            string iCarInterfaceName = typeof(ICar).Name;

            bool isCreated = typeof(ICar).IsInterface;

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

            var  driver  = Console.ReadLine();
            ICar ferrari = new global::Ferrari(driver);

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