0
BaseClass obj = new DerrivedClass();
What this line does is instantiate a new DerrivedClass of type BaseClass. Why does this work? Because DerivedClass is already an implementation of BaseClass.
Although this is just confusing code, you can make it more readable by changing obj's type to DerrivedClass too, it won't change anything.



