Abstract
The presence of Multiple Inheritance in a language raises subtle problems related to possible ambiguities. To avoid handling these difficulties, many languages, including Java, do not support multiple inheritance. This paper studies the problem of implementing multiple inheritance in a class-based language that does not provide it. In particular we propose an experimental extension of Java, M-Java, which enables multiple inheritance, and a precompilation process translating M-Java programs into standard Java programs. This translation process is automatic and transparent to the programmer. The distinguishing feature of our proposal is that crucial semantic aspects of multiple inheritance, related to overriding and subtyping, are preserved by the translation process. We show that such aspects are not preserved in other alternative solutions, presented in the literature, which rely on simulating multiple inheritance by delegation techniques. We will also show that, due to language features, some problems still arise concerning protected methods.
Published Version
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have