This section contains 116 words (approx. 1 page at 300 words per page) |
What is the difference between an object and a class? A class is a definition of an object type. For example, say Rectangle is a class. The Rectangle (with a capital "R") class defines what a rectangle (lowercase "r") object is and how it behaves. However, a rectangle object does not actually exist until the user instructs the drawing program to create one. Each rectangle object created (or instantiated) is said to be an instance of the Rectangle class. Because object- oriented languages are frequently case sensitive, class names usually have the first letter capitalized, while instance names and member names have a lowercase first letter.
This section contains 116 words (approx. 1 page at 300 words per page) |