Go backward to
Inheritance of Class Structures
Go up to
Top
Go forward to
Object-Oriented Languages
Inheritance Issues
Are declarations local to superclass also visible to subclass?
public
inheritance in C++.
Violates static scoping laws!
Overrriding
of class methods:
class
T
=
record proc
P
= ...
end
;
class
U
=
inherits
T
with record proc
P
= ...
end
;
var
X
:
U
in call
X
.
P
P
of
U
is invoked.
Multiple inheritance
class
T
=
record proc
P
= ...
end
;
class
U
=
record proc
P
= ...
end
;
class
R
=
inherits
T
,
inherits
U
with
...
end
;
var
X
:
R
in call
X
.
P
Which
P
is selected?
Author:
Wolfgang Schreiner
Last Modification: May 14, 1998