In the example used below, we will store information on the fruit grown on a given farm. The attributes of the class Fruit are color and weight . In this document, attribute names are displayed in italics. In the real world, all fruit have color and weight. Color and weight are proper attributes of Fruit .
Melon inherits color and weight , and has a proper attribute, vine length .
Honeydew inherits color , weight , and vine length from Melon and Fruit . Using our terminology, vine length is a proper attribute of Melon , and an inherited attribute of Honeydew . The following diagram shows the hierarchy we've established, fleshed out to show some attributes of the classes. The problem here is that there might be many green watermelons that came from a 15 foot vine and weighed 1.25 pounds. To fully specify an instance there must be some way to uniquely identify each watermelon to distinguish between those with identical characteristics.