0
有人问以下问题,OOP多重继承,多态,聚集和枚举
Class C inherits from class B, class B inherits from class A
Would you call this
(1) Multiple inheritance
(2) Polymorphism
(3) Aggregation
(4) Enumeration
现在我不能确定这一点,所以我说枚举。正确的答案是多态。我可以理解为什么,但是我很难从OOP原理中解释这一点。
另外,当谈到OOP时,3和4会表示什么?
谢谢。
正确的答案是以上都不是。它只是2级的继承。它不是多态:http://en.wikipedia.org/wiki/Polymorphism_(computer_science) – thang