What is a class?

What is a class? Throughout this course We have used various intuitive metaphors to try to exaplain the idea. We have said that a class is like a cookie cutter, it is a mechanism we can use to stamp out multiple copies or clones of some object. We have said that a class is a generalization of a record, in as much as it can hold data fields like a record. We have said that a class is a mechanism for variable scoping and encapsulation, like a module. And we have said that a class introduces a new type. In some languages, such as Smalltalk, we have said that a class is an Object.

All of these are, to some extent, true and all of them are just small ways of streching the truth.

[audio] [real] Text to accompany slide3, in Chapter 20 of An Introduction to Object-Oriented Programming