An Object or a Class

views updated

AN OBJECT OR A CLASS?

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.

More From encyclopedia.com

About this article

An Object or a Class

Updated About encyclopedia.com content Print Article

You Might Also Like

    NEARBY TERMS

    An Object or a Class