In
our everyday life, many of us oftentimes try to hide information from other
people. In many situations, the information hiding is an essential part of our
life. For example, when we go grocery shopping, do we allow the store clerk to
withdraw money from our wallet? The wallet (which is an object in
object-oriented terms) hides money (which is the information or attribute/field
of an object) from outsiders. A wallet may provide a method called “pull out X
dollars” that, when executed by an outside object, results in handing over X
dollars to the caller without disclosing how much money is in it. This is
called information hiding in object-oriented programming.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
In our everyday life, many of us oftentimes try to hide information from other people. In many situations, the information hiding is an essential part of our life. For example, when we go grocery shopping, do we allow the store clerk to withdraw money from our wallet? The wallet (which is an object in object-oriented terms) hides money (which is the information or attribute/field of an object) from outsiders. A wallet may provide a method called “pull out X dollars” that, when executed by an outside object, results in handing over X dollars to the caller without disclosing how much money is in it. This is called information hiding in object-oriented programming.