static void Main(string[] args) { DoSomething worker = new InsultMe(); worker.whatToDo(); worker = new InspireMe(); worker.whatToDo(); }
static void Main(string[] args) { DoSomething worker = new InsultMe(); worker.DoWhateverItIsThatIDo(); worker = new InspireMe(); worker.DoWhateverItIsThatIDo(); // In this case base class method is invoked worker = new DoWhatBaseClassDoes(); worker.DoWhateverItIsThatIDo(); }