Introduction to OOP Chapter 14: Polymorphism and Software Reuse: next previous audio real text

Using Inheritance

Only need specify what is new - the addition method. Everything else is given for free.

class Set : public List { 
	void add(int);

void Set::add(int x) 
	if (! includes(x)) // only include if not already there
Intro OOP, Chapter 14, Slide 06