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

Encapsulation

Encapsulation refers to the hidden nature of an object's data components. We know that the data is there, but cannot access it directly because external entities cannot directly interact with that data:

Inheritance examples

The illustration above demonstrates how a Bicycle class protects its data from external methods and functions. The object's own methods are the only mechanism that can directly view or alter its data.

主站蜘蛛池模板: 汪清县| 星子县| 巫山县| 西昌市| 聊城市| 庄河市| 都江堰市| 本溪市| 大石桥市| 芦溪县| 夹江县| 慈溪市| 伊通| 梁平县| 马山县| 道真| 仁化县| 财经| 静安区| 正宁县| 德令哈市| 宕昌县| 岳普湖县| 吴川市| 二连浩特市| 娄烦县| 青海省| 张北县| 罗江县| 庆城县| 朝阳市| 桦川县| 迁安市| 资源县| 贵德县| 南宁市| 颍上县| 望城县| 蓬莱市| 邳州市| 阜南县|