What is exact difference between Inheritance and Abstract class?

后端 未结 5 901
心在旅途
心在旅途 2021-02-06 00:46

I know the fundamentals of OOP concepts[Inheritance, Abstraction, Encapsulation, Polymorphism]

We use Inheritance in case of Parent-Child relationship[C

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-06 01:21

    After java 8 you can have static and default methods in Interface. So it makes the interface much similar to abstract class.

    But Still abstract class is class so we can have constructor, instance variable, getter and setter to change the state of objects. These all functionalities not provided by interface .That is main difference between interface and abstract class after java 8.

提交回复
热议问题