Step by Step Economics

download Step by Step Economics

of 1

description

IT

Transcript of Step by Step Economics

We are going to start by rewriting our program about the rectangle and the triangle of the previous section takinginto consideration this pointer compatibility property:In C++ it is perfectly possible that a class inherits members from more than one class. This is done by simplyseparating the different base classes with commas in the derived class declaration. For example, if we had aspecific class to print on screen (COutput) and we wanted our classes CRectangle and CTriangle to also inherit itsmembers in addition to those of CPolygon we could write:We are going to start by rewriting our program about the rectangle and the triangle of the previous section takinginto consideration this pointer compatibility property:In C++ it is perfectly possible that a class inherits members from more than one class. This is done by simplyseparating the different base classes with commas in the derived class declaration. For example, if we had aOne of the key features of derived classes is that a pointer to a derived class is type-compatible with a pointer toits base class. Polymorphism is the art of taking advantage of this simple but powerful and versatile feature, thatbrings Object Oriented Methodologies to its full potential.One of the key features of derived classes is that a pointer to a derived class is type-compatible with a pointer toits base class. Polymorphism is the art of taking advantage of this simple but powerful and versatile feature, thatbrings Object Oriented Methodologies to its full potential.