View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Spring2004 Midterm Review: O-O Systems

1. A class is a blueprint for a grouping of data and behaviors with a single, common purpose. An instance is a single incarnation of a class, with specific data.
2. To call a class method, you use the class name as the receiver of the message. For example, new in 'Box new' is a class method.
To call an instance method, you use the instance as the receiver.
3. A class variable is shared by all instances of the class. An instance variable is private to the instance.
4. new is a class method because it is called by Box which is a class, when it is returned, you have an instance of Box which then calls initialize which is an instance method.
  - Actually Box is not calling the new method. The Class Box is receiving the new message which returns an instance of Box that in turn receives the instance message initialize.