Joseph Dionne said:
But I cannot even extend the Enumeration interface be adding a new
parameter, i.e. nextMethod(boolean b), to achieve my affect. And I was
unaware that the throws was part of a method signature. Using your rule
of thumb, one should not be able to extend a class where a method throws
additional exceptions.
You cannot change the signature of a method in a subclass
or sub-interface. If you change the parameters, then you
are just overloading the name. Changing the "throws" clause
to add a new checked exception is not permitted, because
existing clients of the method are not prepared to handle
the new exception.
If you add a new method, either by a new name or a new
signature that cannot be confused with an existing
method signature in the interface hierarchy, then you
can specify whatever you need in that method's "throws"
clause. However, clients must refer to the instance
type using the sub-interface type in order to see the
new method at compile time.
Thus, you cannot change the Enumeration methods in
a sub-interface. You cannot use a sub-interface to
specify an alternative method that throws your desired
exception, and use that sub-interface in an implementing
instance as an "Enumeration" reference type. You must
use the sub-interface type at compile time.