官术网_书友最值得收藏!

Polymorphism

You might hear of polymorphism referred to as the third pillar of OOP. But if I wrote it in that order above, my mnemonic would no longer work!

Polymorphism is a Greek word that refers to something that has many shapes or forms. We will see an example of this in the Cricket Score Tracking app later on. Just remember that it has two distinct aspects:

  • During runtime, a class that is derived from a base class may be treated as an object of the class it inherits. This is seen in parameters, collections, and arrays.
  • The base class can define virtual methods that the derived class would then override. The derived class then provides their own implementation of the overridden methods.

Polymorphism is a very powerful feature in OOP.

主站蜘蛛池模板: 朝阳县| 府谷县| 台北市| 乌苏市| 新野县| 凤翔县| 平舆县| 延边| 平邑县| 柞水县| 潞西市| 九龙县| 安宁市| 柏乡县| 晋中市| 南康市| 明星| 龙井市| 舞钢市| 晋宁县| 治县。| 乐陵市| 汝南县| 新乡县| 绍兴县| 黄石市| 房产| 漠河县| 石林| 乌恰县| 昌江| 四平市| 儋州市| 鄂伦春自治旗| 宁波市| 云龙县| 绩溪县| 林周县| 任丘市| 富民县| 清水河县|