Learn Finance C++, Lesson 33, Inheritance, Part I
Andy009Duncan
We begin the first part of class inheritance by borrowing from our Bond class (the underlying or base class) and generating a new DurationBond class (the derivative or derived class). This new class gets to use all of the features of the Bond class, without having to copy and paste them into itself. This is the 'magic' of object orientation, where a 'Sports Car' can inherit the features of a 'Car', and a 'Hyper Car' can inherit the features of a 'Sports Car', without having to rewrite any of the code of the well-tested reliable underlying classes. We will continue to develop this DurationBond class in further lessons.
http://andyjamesduncan.wordpress.com
Finished code blocks:
http://andyjamesduncan.wordpress.com/2013/02/22/learn-finance-c-lesson-33-inheritance-part-i/ ... https://www.youtube.com/watch?v=cBuKg3EDfVw
101345044 Bytes