Introduction to OOP: Chapter 9: Mechanisms for Software Reuse [next] [previous] [audio] [real] [text]

Example - Building Sets from Lists

Suppose we have already a List data type with the following behavior:

Want to build the Set data type (elements are unique).

class List {
	void add(int);
	int  includes(int);
	void remove(int);
	int firstElement();
Intro OOP, Chapter 9, Slide 7