• Animal
  • Auto
  • Computers
  • Education
  • Finance
  • Health
  • Math
  • Mobiles
  • Programming
  • Science
  • Sports
  • Technology
  • Terms
  • Web

  • Difference Between Implementation Inheritance and Interface Inheritance

    Implementation Inheritance vs Interface Inheritance

    Both Implementation Inheritance and Interface Inheritance are types of inheritance. Inheritance is the concept of Object Oriented Programming (OOPs). Inheritance is used for code reuse. Check out the Differences between Implementation Inheritance and Interface Inheritance.

    Implementation Inheritance

    Implementation Inheritance

    1. Implementation Inheritance is called Class Inheritance.
    2. Implementation Inheritance is achieved in Java by using the extends keyword.
    3. Implementation Inheritance should be used only when the subclass IS A superclass (relationship).
    4. In this inheritance, the subclass is tightly coupled with superclass.
    5. Any changes to superclass will break the whole relationship. Make sure that the subclasses depend only on the behaviour of the superclass, not on the actual implementation.

    Interface Inheritance

    Interface Inheritance

    1. Interface Inheritance is called Type Inheritance also called as subtyping.
    2. Interface Inheritance is achieved in Java by using the implements keyword and Object Composition (HAS A relationship).
    3. Interface Inheritance is used for Code reuse and polymorphism and there is no IS A relationship.
    4. Interface inheritance reduces coupling and implementation dependencies. You can use inheretance between unrelated classes but has set of common methods.
    5. Interface inheritance promotes the design concept of program to interfaces not to implementations.

    These are the Difference between Implementation Inheritance and Interface Inheritance, If you know more differences, Do contribute by leaving the comment. I will be happy to add them in this post.

    Posted under: Programming
    1957 readers are already subscribed to this blog! Why don't you be one of them? Subscribe to this blog via your favorite RSS feed reader or by entering your email address on the form below:

    Leave a Reply

    page counter
    NiharsWorld on Twitter NiharsWorld on Facebook NiharsWorld RSS Feed