«
^
»
4. Using classes for data abstraction
Introduction
Using a class declaration to define your own type
A class called
Date
Stage A: providing a primitive version of the class
Date
Stage B: adding a constructor and a method declaration
Grouping fields and methods together to implement a type
Stage C: hiding fields, providing access methods and
toString
Using the default version of
toString
Stage D: providing class variables, class methods and class constants
Stage E: the final version of the
Date
class
The role of a class