Data Hiding of object oriented programming

Home/Data Hiding of object oriented programming
Data Hiding of object oriented programming 2018-03-22T14:19:56+00:00

Data hiding can be defined as the mechanism of hiding the data of a class from the outside world or to be precise, from other classes. This is done to protect the data from any accidental or intentional access. In most of the object oriented programming languages, encapsulation is implemented through classes. In a class, data may be made private or public. Private data or function of a class cannot be accessed from outside the class while public data or functions can be accessed from anywhere. So data hiding is achieved by making the members of the class private. Access to private members is restricted and is only available to the member functions of the same class. However the public part of the object is accessible outside the class.

 

PiRuby is the perfect Tool to Discover Educational Content from Textbooks. Learning and Excellence Made Easy… Really Easy!