Thursday 26 June 2014

How can a Class enforce data- hiding, abstraction and encapsulation..

Class enforces data- hiding, abstraction and encapsulation..


What does a class actually do, it binds together data and its associated functions under one unit and because of that enforcing encapsulation as encapsulation means wrapping up of the data and associated functions together into a single unit .

And a Class groups its members into three sections : as private , protected and public.The members like private and protected remains hidden from the outside world.Thus through these private and protected members a  class enforces data hiding.

The Main function of the public member is only to give the important and essential information to the outside world and because of that rest things remain hidden , which is also called as abstraction. As it basically means representation of essentials features without including the background details .

No comments:

Post a Comment