What is the difference between Abstraction and Polymorphism

后端 未结 11 679
别那么骄傲
别那么骄傲 2021-01-30 07:17

I seem to not understand two OOP concepts very well. Could you explain what abstraction and polymorphism are, preferably with real examples and

11条回答
  •  旧时难觅i
    2021-01-30 07:38

    In simple term, Abstraction is conceptual and Poly is behavioral. In order to achieve abstraction in OOP, you need Poly.

    Abstraction in object oriented programming is a concept or design pattern I may say, which enables better isolation, loosely coupling thus testability, and reusability and extensibility. In order to achieve all, we need poly, inheritance/extension and etc.

提交回复
热议问题