Esempio n. 1
0
        private static void Main(string[] args)
        {
            var john = new Humanoid(new Dancing());

            Console.WriteLine(john.ShowSkill()); //print dancing

            var alex = new Humanoid(new Cooking());

            Console.WriteLine(alex.ShowSkill());//print cooking

            var bob = new Humanoid();

            Console.WriteLine(bob.ShowSkill());//print no skill is defined
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var john = new Humanoid(new Dancing());

            Console.WriteLine(john.ShowSkill()); //print dancing

            var alex = new Humanoid(new Cooking());

            Console.WriteLine(alex.ShowSkill());//print cooking

            var bob = new Humanoid();

            Console.WriteLine(bob.ShowSkill());//print no skill is defined
            Console.WriteLine("Press any key to exit");
            Console.ReadLine();
        }