Introduction to OOP Chapter 13: Multiple Inheritance: next previous audio real text

One Solution: Redefinition

One solution is to redefine one or the other operation in the child class.
class GraphicalCardDeck : public CardDeck, public GraphicalObject {
public:
	virtual void draw () { return CardDeck::draw(); } 
	virtual void paint () { GraphicalObject::draw(); }
}

	GraphicalCardDeck gcd;
	gcd->draw(); // selects CardDeck draw
	gcd->paint(); // selects GraphicalObject draw
Intro OOP, Chapter 13, Slide 09