![](GBookT3.jpg)
![](GBookT4.jpg)
Click here to see the codes for
GradeBookTest.
set
and
get
methods
- A
class’s
private
fields can be manipulated only by the class’s methods.
- A
client of an object
calls the class’s
public
methods to manipulate the
private
fields of an object of the class.
-
Classes often provide
public
methods to allow clients to
set
(i.e., assign values to) or
get
(i.e., obtain the values of)
private
instance variables.
-
The names of these methods need not begin with
set
or
get,
but this naming convention is recommended.