
Our next example is dim3, which
allows users to type the month
name, rather than a number between
1 and 12.

To implement this capability,
we added a protected array named
MonthNames into MonthInfo.

Even though this field is not
accessible outside of the package,
it can be used by any class
that extends MonthInfo.

We extend MonthInfo to a class
outside of the package called
MyMonthInfo, which uses the
MonthNames array to create a
smarter version of daysInMonth()
that takes a String argument,
thereby allowing the user to
enter the month name.

