Example #1
0
        static void Main(string[] args)
        {
            MyBaseObject myBaseObject = new MyFirstConcreteObject();
            MyFirstConcreteObject myConcreteObject = new MyFirstConcreteObject();

            Console.WriteLine("myBaseObject");
            myBaseObject.MethodForNew();
            myBaseObject.MethodForOverride();
            myBaseObject.MethodForOverride2();

            Console.WriteLine("");
            Console.WriteLine("myConcreteObject");
            myConcreteObject.MethodForNew();
            myConcreteObject.MethodForOverride();
            myConcreteObject.MethodForOverride2();

            Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            MyBaseObject          myBaseObject     = new MyFirstConcreteObject();
            MyFirstConcreteObject myConcreteObject = new MyFirstConcreteObject();

            Console.WriteLine("myBaseObject");
            myBaseObject.MethodForNew();
            myBaseObject.MethodForOverride();
            myBaseObject.MethodForOverride2();

            Console.WriteLine("");
            Console.WriteLine("myConcreteObject");
            myConcreteObject.MethodForNew();
            myConcreteObject.MethodForOverride();
            myConcreteObject.MethodForOverride2();


            Console.ReadKey();
        }