what's the difference between inheritance and polymorphism?

前端 未结 8 1793
[愿得一人]
[愿得一人] 2020-12-05 05:08

can you give me a simple example of inheritance and polymorphism, so it could be fully clear and understandable?

using C# would make it more clear, as I already lear

8条回答
  •  萌比男神i
    2020-12-05 05:55

    Polymorphism is the act of overriding what you Inherited.

    If you don't override it, it's not polymorphism, it's just inheritance.

提交回复
热议问题