multiple inheritance
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
why java does not support multiple class inheritance. as c++ support.
help!!!
help!!!
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Is that a question ?
welcome to javaranch singh rajiv
welcome to javaranch singh rajiv
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Because multiple inheritance causes complicated problems such as the diamond problem and because you rarely need multiple inheritance in practice.
The designers of the Java programming language wanted to make a language which was easier to use than C++, so they left out complicated and unnecessary features such as multiple inheritance.
Note that your question is a frequently asked question. Search the forums and you'll find lots of older discussions about why Java does not support multiple inheritance.
The designers of the Java programming language wanted to make a language which was easier to use than C++, so they left out complicated and unnecessary features such as multiple inheritance.
Note that your question is a frequently asked question. Search the forums and you'll find lots of older discussions about why Java does not support multiple inheritance.
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
don't use 31 exclamation marks after a word (especially "help"), it freaks me out !!
I agree with Jesper Young over the complications part,
Imagine java with "virtual functions" !
I hope your next question is not on operator overriding ...
I agree with Jesper Young over the complications part,
Imagine java with "virtual functions" !
I hope your next question is not on operator overriding ...
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Personally, I like multiple inheritance and miss it. I prefer other implementation patterns, like mixins or traits, but I don't feel as many do that multiple inheritance is inherently evil.
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
From what i've read, the designers thought that the headaches caused by multiple inheritance vastly outweighed any benefits gained by including it.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
java supports multilevel inheritence that is
one class can extend only one class
i think its made like this just to make it more security conciusnessor just to avoid duplication of variables from different classes or just to avoid errors like duplicate declaration of variables??
Also with the intro of interfaces ,i think its quite a good replacement for multiple inheritence
one class can extend only one class
i think its made like this just to make it more security conciusnessor just to avoid duplication of variables from different classes or just to avoid errors like duplicate declaration of variables??
Also with the intro of interfaces ,i think its quite a good replacement for multiple inheritence
http://www.lifesbizzare.blogspot.com || OCJP:81%
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
It's not supposed to have anything to do with variables, but with methods.
posted 15 years ago
sir we are accesiing variablle of a class using b's object? doesnt both variables and methods come into play?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Campbell Ritchie wrote:It's not supposed to have anything to do with variables, but with methods.
sir we are accesiing variablle of a class using b's object? doesnt both variables and methods come into play?
http://www.lifesbizzare.blogspot.com || OCJP:81%
posted 15 years ago
No, it's not; you still have to re-implement behavior. It avoids some pitfalls at the cost of repetition.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Vishal Hegde wrote:Also with the intro of interfaces ,i think its quite a good replacement for multiple inheritence
No, it's not; you still have to re-implement behavior. It avoids some pitfalls at the cost of repetition.
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
The diamond problem still exists with interfaces.....then why was multiple inheritence removed...was there any technical reason?
posted 15 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Not really.
There's no implementation inheritance, so it doesn't matter which interface you're referring to--you can only implement one method with a given signature. No matter which interface your object is currently acting like it'll call the same implementation--no diamond problem. The diamond problem refers to implementation disambiguation.
There's no implementation inheritance, so it doesn't matter which interface you're referring to--you can only implement one method with a given signature. No matter which interface your object is currently acting like it'll call the same implementation--no diamond problem. The diamond problem refers to implementation disambiguation.
| I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |











