• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAVA SUPPORTS MULTIPLE INHERITANCE

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was wondering since every object extends from Object Class ..so if one class extends from another it already extends from the Object class.
Shouldnt this line be more Java doesnt support user defined multiple inheritance..
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, that would be like saying that Kitty is two different things at once because he's both a cat and an animal. But he isn't two different things at once, because Cat is-a Animal. Now to say that Kitty were simultaneously a cat and a horse, that would be like multiple inheritance.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

| |
| |



C extends A and C extends B, where A and B are different entities. Then C has multiple inheritance.

Sreeds
[ March 25, 2005: Message edited by: San Sreeds ]
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
poor kitty !!!

Sorry.. guys.. couldn't help but add a little humor.
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have about 70 books on my shelf on the Java programming language (a bit excessive I know) starting with one published around 1997 and they all say Java does not support Multiple Inheritance. Now they might all be wrong but...
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java supports only interface inheritance.
You may inherit zero or more interfaces, which have only abstract (no impl) methods.
Java does not support multiple concrete inheritance.
A Java class has one and only one superclass, not zero, not two.
The only exception to this rule is for java.lang.Object, which has zero superclasses.
A Java class inherits from java.lang.Object, directly or indirectly, through concrete inheritance. Each leaf node of the tree has one and only one parent.

Frankly, I don't understand why:
a) this trivial concept is so difficult to grasp
b) this concept continues to be the focus of discussion even after the language has matured
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic