static void Main(string[] args) { Base b = new Base(); b.Execute(); b = new Derived(); b.Execute(); }
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() }