What is polymorphism, what is it for, and how is it used?

前端 未结 28 2815
南笙
南笙 2020-11-21 07:08

What is polymorphism, what is it for, and how is it used?

28条回答
  •  梦谈多话
    2020-11-21 07:40

    Polymorphism literally means, multiple shapes. (or many form) : Object from different classes and same name method , but workflows are different. A simple example would be:

    Consider a person X.

    He is only one person but he acts as many. You may ask how:

    He is a son to his mother. A friend to his friends. A brother to his sister.

提交回复
热议问题