Safety (Cont.)


Redefined Attributes and Methods (Cont.)
(Redefinition of attributes) The type of a redefined attribute must be a subtype of the type of the original attribute.


Assume a is a variable of type classA. If a references an object of class classB: (Redefinition of methods) The types of the arguments of the redefining signature must be supertypes of the arguments of the redefined signature.

classB IsA classA
meth ( classA, type11, ..., type1k ): typeA
meth ( classB, type21, ..., type2l ): typeB

Assume a is a variable of type classA. If a references an object belonging to classB: