1 2 3 Previous Next 35 Replies Latest reply: Jan 5, 2005 4:01 AM by jwenting Go to original post RSS
      • 30. Re: Multiple Inheritance
        Yep, Java simply annihilates the problem by not offering the nasty (but
        powerful) MI of implementation ... it doesn't deal with name
        collisions from different interfaces though, which I find a bit ugly. (all
        IMHO that is).
        I've never really run into this though. I think it only really comes up frequently (if
        that) when developers think that they have to have a single class that
        implements a billion different interfaces. Usually I find it more clean to use
        inner classes (etc.) to implement non-primary interfaces.
        I don't run into name collisions that much either; but that isn't a Java language
        problem, it's a natural language problem where we have to deal with homonyms
        (words/verbs that mean different things, but are written identically), the verb 'draw'
        is a nice example here ...

        BTW, if a class implements a zillion interfaces, that class exhibits a lot of 'faces'
        (sic) and deserves to run into trouble by its sheer (mis)design ;-)

        Jos (implements Sleepy, Thirsty, Tired, StillHungry, LotToDo, NeedsADrink)
        • 31. Re: Multiple Inheritance
          Well, Eiffel supports multiple inheritance (does not have interfaces), but deals with the diamond problem in a ad-hoc way . From the documentation:


          Multiple Inheritance
          Robust multiple inheritance facilities are essential to support combining various abstraction s and reusable components. The Eiffel-unique mechanisms of renaming (to eliminate name clashes), "join", and "select" (removes ambi guities from multiple redeclarations) ensure a powerful tool that dramatically improves both modeling and design/implementation

          Another Eiffel article:
          • 32. Re: Multiple Inheritance
            why multiple inheritance is not allowed in java?
            • 33. Re: Multiple Inheritance
              why multiple inheritance is not allowed in java?
              What about acually reading the thread you have posted in?

              • 34. Re: Multiple Inheritance
                why multiple inheritance is not allowed in java?
                Newbies messed around too much with C++ multiple inheritance producing tons of buggy code. Java took the hint and made it better for developers.

                • 35. Re: Multiple Inheritance
                  why multiple inheritance is not allowed in java?
                  Simple: because James Gossling doesn't like it and he wrote the language specs.

                  Since the language specs define the language and MI is not allowed according to the language specs MI is not allowed.

                  No other reason is needed. You could just as well ask why Java is case sensitive or why the sun is pink.
                  1 2 3 Previous Next