Example 6 (3)
Class declaration (continued):
public String toString () { // Return this date rendered in ISO format. int y, m, d; …; return (y + '-' + m + '-' + d); }
public void advance (int n) { // Advance this date by n days (where n = 0). this.d += n; }