Home TechnologyProgrammingJava Subscribe to RSS

Why In Java Is Multiple Inheritance Is Not Supported?

Answer Question

2 Answers - Sort by: Date | Rating

    The question whether Java supports multiple inheritance or not can simply be answered as both yes and no. In fact, Java separates implementation inheritance from interface inheritance. Interface inheritance deals with the contract to which a class adheres. On the other hand, implementation inheritance deals with both the reuse of the code and the contract to which a class adheres.

    Java only permits the multiple inheritances of interfaces and the single inheritances of implementation. It is different from other programming languages such as C++ where both the concepts are intermingled, which makes them unnecessary complicated. Java is a simpler programming language than other programming languages such as C++. This is because in Java, the concepts of interface inheritances and implementation inheritances are not intermingled. Since the Java programming language does not support multiple inheritance, it allows a class to extend more than one class of bases. Multiple interfaces are similar to multiple inheritances.
    0 0

    Aki  

    answered 3 years ago

      Hi... As we all know we can implement multiple interfaces in java,but only single inheritance.as i think that is because in interfaces there is not a method body so no problem occurs when implementing more than one interfaces,but when inhering from another class  problems occur when using multiple inheritance since there can be a method body in the super classes(if we didnt override and just call a metode of super class if that method defined in more than one super classes there will be a problem)
      0 0
      Guest

      Guest  

      answered 6 months ago

        More

           
           

          Ask a Question via Twitter

          Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

          Blurtit Store

          Get T-shirts, hoodies, caps and more at the Blurtit store

          Blurtit International