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

Encapsulation

Simply put, this means that the inner workings of the class (the implementation details) are not necessarily shared with outside code. Remember that we mentioned earlier that a class is something that you just want to use and expect it to work. The class exposes what it needs to to the calling code, but it maintains tight control over the inner workings it implements.

You can, therefore, hide the variables, properties, and methods by scoping them as private. This way, you protect the data contained inside the class from accidental corruption.

主站蜘蛛池模板: 巴彦淖尔市| 繁昌县| 九台市| 碌曲县| 伊通| 新津县| 会理县| 墨竹工卡县| 麻江县| 仁布县| 静安区| 淮滨县| 介休市| 家居| 正蓝旗| 河津市| 浪卡子县| 兴山县| 吴桥县| 会泽县| 来安县| 达日县| 乐陵市| 石景山区| 平泉县| 宽甸| 石门县| 江华| 瑞安市| 玛沁县| 克什克腾旗| 织金县| 岢岚县| 嵊泗县| 宣恩县| 合江县| 城口县| 毕节市| 交城县| 肃宁县| 云梦县|