Separating Accessors and Mutators
Better interface:
String getToken(); void nextToken();
Even more convenient:
String getToken(); String nextToken(); // returns current
Refine rule of thumb:
Mutators can return a convenience value, provided there is also an accessor to get the same value
previous
|
start
|
next
.... [Slide 24] ....