Пример #1
0
        static void Main(string[] args)
        {
            var p = new BaseParent();

            p.HaveAParty();
            var c = new DerivedChild();

            c.HaveAParty();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var p = new BaseParent();

            p.HaveAParty();
            var c = new DerivedChild();

            c.HaveAParty();
            var t = new DerivedTeenager();

            t.HaveAParty();

            var cat = new Cat();

            cat.Sound();
            var dog = new Dog();

            dog.Sound();
        }