Confused about is-a relationship (static and dynamic types) [Answered]
// TestingBaseClass newObject = new BaseClass();BaseClass newObjectB = new DerivedClass(209.21312f);
// TestingBaseClass newObject = new BaseClass();BaseClass newObjectB = new DerivedClass(209.21312f);
What's with the syntax on the second line? And why would we ever use the syntax on the second line if it limits us to using only the members in DerivedClass? Like is
BaseClass newObjectB = new DerivedClass(209.21312f);
BaseClass newObjectB = new DerivedClass(209.21312f);