The primary purpose of a public method is to present to the class's clients a view of the services the class
provides: the public interface of the class.
We don't want clients to devise code that depends on the class's implementation.
The class definition thus hides everything but the interface from clients:
private members
definitions of its public members.
The applet in Fig. 6.2 has 2 compile errors (t.hour and t.minute).
These variables are not accessible to TimeTest'spaint method.
A class's get methods (aka accessor methods) can carefully control the view of the object that the client sees.
A class's set methods (aka mutator methods) can:
ensure that only valid settings
translate the user's view of the object to its implementation representation.
For example, in the Time class, setTime can translate from military time format to raw seconds (if Time had
seconds as its sole instance variable).