static void Main(string[] args)
        {
            Base b = new Base();

            b.Execute();
            b = new Derived();
            b.Execute();
        }
Esempio n. 2
0
        public static void Start()
        {
            Base b = new Base();

            b.Execute();             // displays Base.Execute()
            b = new Derived();
            b.Execute();             // also displays Base.Execute() because not virtual/override
            Derived d = new Derived();

            d.Execute();             // displays Derived.Execute()
        }