Wondering what the difference is between the following:
Case 1: Base Class
public void DoIt();
Case 1: Inherited class
<
The functional difference will not be show in these tests:
BaseClass bc = new BaseClass();
bc.DoIt();
DerivedClass dc = new DerivedClass();
dc.ShowIt();
In this exmample, the Doit that is called is the one you expect to be called.
In order to see the difference you have to do this:
BaseClass obj = new DerivedClass();
obj.DoIt();
You will see if you run that test that in the case 1 (as you defined it), the DoIt() in BaseClass is called, in case 2 (as you defined it), the DoIt() in DerivedClass is called.