Introduction to OOP Chapter 16: Overriding : next previous audio real text

Making Child Classes

We can create child classes to any level:
class OSUAnchor extends Anchor {
	public void printAnchor () {
		print('//www.cs.orst.edu/');
		inner;
	}
}

class BuddAnchor extends OSUAnchor {
	public void printAnchor () {
		print('~budd/');
		inner;
	}
}

	Anchor anAnchor = new BuddAnchor();
	anAchor.printAnchor();
<A href=http:"//www.cs.orst.edu/~budd/">
Trace carefully the flow of control, and see how it differs from replacement.
Intro OOP, Chapter 16, Slide 15