add
//output :: hihi
virtual.htm |
add
|
y-asst35-40.txt |
add
item 35: make sure public inheritance models an "is-a"
he gives examples of how a penguin can't inherit from a flying bird; we will need an abstract bird class, then inherit two classes from that, for "flying bird" and "non-flying" bird. Then, use a virtual void function() for flying in the abstract "flying bird" class.
item 36: differentiate between inheritance of interface and inheritance of implementation
this section emphasizes the importance of knowing the difference between inheriting the interface and inheriting the implementation. Derived classes must not always inherit the implementation of base classes; if we want to inherit the full implementation of the base class' function, we should use 'public inheritance' and need not use 'virtual void' functions, which cause the derived class to inherit only the base class's interface.
| --->upload your article
|
User submitted category site links |
|
(None) | -->submit a page from your site dealing with virtual to the sirfsup! web directory for listing | |