将数据成员和成员函数包装进类中,加上具体实现的隐藏共同被称作封装,其结果是一个同时
带有特性和行为的数据结构。
将数据和实现细节隐藏的原因:
1.对模块的任何实现细节所作的更改不会影响使用该模块的代码
2.防止用户意外修改数据
3.使模块易于使用和维护