Introduction to OOP: Chapter 14 : Polymorphism [next] [previous] [audio] [real] [text]

Deferred Method in C++

class Shape {
public:
	Point corner;
	void virtual draw() = 0;
};

class Circle : public Shape {
public:
	int radius;
	void draw() { drawCircle(corner + radius, radius); }
};
Intro OOP, Chapter 14, Slide 18