Notes - 03/17


Outline

Review lab from Monday
Class activity - another chance to practice with polymorphism
Intro to abstract classes (an example)
Book example
abstract class
You have several classes providing the same functionality in the same way. The parent is a very generalized version of the children, so it doesn't make sense to build concrete cases of one. Ex: Car - We talk about driving cars, but we are really driving very specific instances of cars. There is no "car" object; they are sedans, station wagons, vans, etc. You can even get down to specific model numbers.
abstract method
An abstract method has no method body.  It must be overridden in the child classes.
concrete class
A class from which objects can be made.  A concrete class cannot contain any abstract methods.

Some properties of abstract classes


CS 239 - Spring 2008
Department of Computer Science Nancy Harris Home Page Current Classes Link