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
- Kevin Adkisson last edited on 10 October 2005 at 1:20 am by adsl-065-007-154-085.sip.asm.bellsouth.net
- Fall 2005 Discussion 4 last edited on 6 December 2005 at 3:45 pm by r36h51.res.gatech.edu