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

Composition

Composition in OOP represents the part of relationship between classes. In this relationship, one class is a part of another class. Let's consider the following example, Composition.py, to understand the composition relationship between classes:

In the preceding example, the relation between the Ferrari car and the engine is of composition type. This is because the engine is part of the car, which is of the Ferrari type.

主站蜘蛛池模板: 长武县| 当涂县| 新建县| 黑山县| 邻水| 德钦县| 河东区| 郴州市| 突泉县| 乐安县| 涪陵区| 肃宁县| 蒙城县| 泽库县| 贡嘎县| 嘉义县| 大关县| 绩溪县| 玉树县| 武宁县| 沅江市| 堆龙德庆县| 浏阳市| 西充县| 玛曲县| 南开区| 车险| 桑日县| 虹口区| 龙门县| 巴林右旗| 永丰县| 辽源市| 安岳县| 通化市| 革吉县| 集贤县| 泰和县| 临猗县| 陵川县| 绥中县|