«^»
4.6. Grouping fields and methods together to implement a type

The above class declaration for Date not only has the declaration of three fields (year, month and day): it also has the declaration of a method (display). Earlier, it was suggested that the two main characteristics of a type are a set of values and some operations to perform on those values. So, one of the major attractions of a class declaration is that it allows us to group together:

The fields and methods are sometimes referred to as the members of the class.