One of the documents supporting the introduction of enum types
says:
‘The enum declaration is a special kind of
class declaration.
An
enum type
has public, self-typed members for each of the
named
enum constants.
All enum classes have high-quality
toString,
hashCode
and
equals
methods.’
On the next screen, there is a program that uses the type Day.
Hidden in this code is a call
of the toString method.