我知道信息隐藏和封装不一定是同一回事,但根据定义,它们似乎是同义词。这让我想知道一个人是否可以在没有另一个人的情况下存在。
问问题
132 次
2 回答
0
In simple way I'll try to explain this things :
Encapsulation is the concept of grouping of related things into one unit.
Information hiding is the concept of restricting an access to the members that we grouped together in above concept.
So if you see, both concepts are similar. Here we can not say there is the dependancy of these concepts on one another.
于 2016-03-21T07:07:56.817 回答
0
封装是对相关项目进行分组的可能性。这些都是成员变量和方法。
而信息隐藏是隐藏内部状态的可能性。
然而在实践中,信息隐藏通常被视为封装的一部分。
于 2016-03-21T09:16:04.883 回答