Introduction to OOP: Chapter 9: Mechanisms for 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 9, Slide 8