static void Main(string[] args) { ScaryScary fingersTheClown = new ScaryScary("big shoes", 14); FunnyFunny someFunnyClown = fingersTheClown; IScaryClown someOtherScaryClown = someFunnyClown as ScaryScary; someOtherScaryClown.Honk(); Console.ReadKey(); }
static void Main(string[] args) { ScaryScary fingersTheClown = new ScaryScary("big shoes", 14); FunnyFunny someFunnyClown = fingersTheClown; IScaryClown someOtherScaryClown = someFunnyClown as ScaryScary; someOtherScaryClown.Honk(); Console.WriteLine(someOtherScaryClown.ScaryThingIHave); someOtherScaryClown.ScareLittleChildren(); Console.ReadKey(); }