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

Discussion 4 - Kevin Adkisson

From Summer 2001 Midterm Review OO Theory section

1. What is a class? What is an instance?
A class is a model for an abstract design element. An instance is an actual object of a class.

2. What is the difference between a class and instance method?
Class methods are methods that are not specific to a particular instance of a class, such as the 'new' method. Instance methods require an actual instance of a class, such as the 'extent' method; these methods will yield different results when called on different instances.

3. What is the difference between a class and instance variable?
Class variables describe something that is common to all instances of a class. Instance variables describe instance-specific data, so they may hold different values for each instance of a class. For example, in an Equation class, "pi" may be a class variable since its value does not change across instances, but "x" may be an instance variable, a part of the equation that the instance represents.

Links to this Page