Esempio n. 1
0
        static void Main(string[] args)
        {
            Chef chef = new Chef(); //super class

            chef.MakeChicken();
            chef.MakeSpecialDish();                      // makes the basic special dish defined in the Chef.cs super class

            ItalianChef italianchef = new ItalianChef(); // sub class inherits from super class

            italianchef.MakeChicken();
            italianchef.MakePasta();       //can only be run by the sub class with the extra method MakePasta
            italianchef.MakeSpecialDish(); //makes the sub class special dish by the override keyword
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Chef chef = new Chef();

            chef.MakeChicken();
            chef.MakeSpecialDish();

            ItalianChef italianChef = new ItalianChef();

            italianChef.MakeChicken();
            italianChef.MakePasta();
            italianChef.MakeSpecialDish();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            // Created a new chef object and told it to make chicken:
            Chef chef = new Chef();

            chef.MakeSpecialDish();

            ItalianChef italianChef = new ItalianChef();

            italianChef.MakeSpecialDish();

            Console.ReadLine();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Chef chef = new Chef();

            chef.MakeChicken();
            chef.MakesSpecialDish();
            Console.WriteLine();
            ItalianChef italianchef = new ItalianChef();

            italianchef.MakePasta();
            italianchef.MakesSpecialDish();


            Console.ReadLine();
        }