Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Multiple Inheritance In Java
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Chris Uppal, post: 614932"] BTW, I would have found your post a lot easier to read if you'd added spaces after the punctuation in the usual way. There are other approaches to multiple inheritance (MI) that don't use the C++ mechanism. In C++ terms, every base class could be 'virtual', for instance. I suspect (or rather, hope) that if Java had been defined to have MI, then the designers would not have duplicated C++'s overcomplicated and fragile semantics in this respect. This is probably true, but the difficulties are more likely (in my guess as to how the Java designers were thinking) to be over-complication of the language for /users/ of the language, rather than for /implementors/ of it. MI is not widely regarded as a Good Thing (though there are dissenting opinions -- my own, for instance ;-). It depends on what /sort/ of inheritance you are talking about. Java allows inheritance of multiple /types/ (though the interface mechanism, as you noted), but does not allow multiple inheritance of /implementation/. Java takes a moderately confused approach to types, in that both interfaces /and/ class names can be used as type names, yet classes are (or perhaps should be) more about /implementation/ than about type. If you consider a hypothetical Java-like language that only allowed interface names (and primitives) to be used as type names, then classes would be used only for implementing behaviour (not for specifying the externally visible API -- the type) then it would be clearer how that language had MI for types, and SI for implementations. Still, for most purposes, if MI is discussed, the context is more likely to be about implementation inheritance, so -- without further clarification -- it would be normal to say that Java does not have MI. (But if you say it on this newsgroup then /someone/ is bound to start going on about interfaces, so it is probably easier in the long run to be clear about which kind of inheritance you are talking about if you make that kind of statement ;-) -- chris PS. My own opinion is that MI is fine for type, and it is also fine for implementation -- the problems start when you try to mix both kinds of MI at once, as in C++. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Multiple Inheritance In Java
Top