This section contains 496 words (approx. 2 pages at 300 words per page) |
Class is a central part of object-oriented programming. Class is defined as a category of objects, which also defines all the common properties of the different objects that belong to it. A program may have more than one object of the same kind. Objects of the same kind belong to the same class. For example, a class called shape would contain triangles, circles, squares, rectangles, pentagons, octagons, and others grouped into the class by virtue of their shape. Implicit in the class shape would be the definitions of these various shapes. Another real-world example is found in a program that monitors heat loss. The program might contain several ducts and fans, and a handful of heaters and users. Objects of the same kind, fans for instance, would be a class. Within the class there could still be individual variations, called instances of the class. Each class, however, shares...
This section contains 496 words (approx. 2 pages at 300 words per page) |