Esempio n. 1
0
        static void Main(string[] args)
        {
            TallGuy tallGuy = new TallGuy() { Height = 74, Name = "Jimmy" };
            tallGuy.TalkAboutYourself();
            tallGuy.Honk();

            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            TallGuy tallGuy = new TallGuy()
            {
                Height = 76, Name = "Jimmy"
            };

            tallGuy.TalkAboutYourself();
            Console.WriteLine($"The tall guy has {tallGuy.FunnyThingIHave}");
            tallGuy.Honk();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            TallGuy tallGuy = new TallGuy()
            {
                Height = 74, Name = "Jimmy"
            };

            tallGuy.TalkAboutYourself();
            tallGuy.Honk();

            Console.ReadKey();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            TallGuy tallGuy = new TallGuy() { Height = 74, Name = "Jimmy" };
            tallGuy.TalkAboutYourself();
            tallGuy.Honk();

            ScaryScary fingersTheClown = new ScaryScary("big shoes", 14);
            FunnyFunny someFunnyClown = fingersTheClown;
            IScaryClown someOtherScaryClown = someFunnyClown as ScaryScary;

            // Maintains `Honk` method though IScaryClown inheriting from IClown
            someOtherScaryClown.Honk();

            Console.WriteLine(someOtherScaryClown.ScaryThingIHave);
            someOtherScaryClown.ScareLittleChildren();

            Console.ReadKey();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            TallGuy tallGuy = new TallGuy()
            {
                Height = 74, Name = "Jimmy"
            };

            tallGuy.TalkAboutYourself();
            tallGuy.Honk();

            ScaryScary  fingersTheClown     = new ScaryScary("big shoes", 14);
            FunnyFunny  someFunnyClown      = fingersTheClown;
            IScaryClown someOtherScaryClown = someFunnyClown as ScaryScary;

            // Maintains `Honk` method though IScaryClown inheriting from IClown
            someOtherScaryClown.Honk();

            Console.WriteLine(someOtherScaryClown.ScaryThingIHave);
            someOtherScaryClown.ScareLittleChildren();

            Console.ReadKey();
        }