Next: Subclasses do not generate
Up: Typing in object-oriented languages:
Previous: Matching is necessary in
While the use of MyType provides us with a great deal of flexibility,
there is one negative consequence of its use that we hinted at earlier.
The problem arises with the binary methods discussed earlier. We can now
describe these more precisely as methods that contain a parameter of
type MyType. The methods , , and
from the and classes in
Section 5 are examples of binary methods. Other familiar
examples include methods and that would require
a parameter of the same type as the receiver, and then return Boolean values.
Kim Bruce
10/28/1998