Home > DeveloperSection > Interviews > What is a information hiding in object oriented programming

Posted on    November-08-2016 1:37 AM

 1 Answer(s)
  314  View(s)
Rate this:

Barbara Jones

Total Post:19

Posted on    November-08-2016 1:37 AM

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.

Modified On Nov-08-2016 01:38:29 AM

Don't want to miss updates? Please click the below button!

Follow MindStick