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.whatToDo(); worker = new InspireMe(); worker.whatToDo(); // In this case the base class method is invoked worker = new DoWhatBaseClassDoes(); worker.whatToDo(); }