-
hoe data hiding is possible in object oriented approch?give me an example please..........0
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a
member of our community. Consider creating an
account or login.
Replies
-
Member • Mar 2, 2013
For example: private data members of a class are hidden from outside.nidhshoe data hiding is possible in object oriented approch?give me an example please..........Are you sure? This action cannot be undone. -
Member • Mar 2, 2013
but we can call this data members by their functions.......so how it will be hidden?Are you sure? This action cannot be undone. -
Member • Mar 2, 2013
Yes we can use functions to access, but then, what is the fun of hiding if u cannot get it when u need it. Think hiding for a simple function(eg add), when a function is called, it's call does not tell actual implementation of that function (ie. how it calculate the value to be returned), similarly when a user clicks add button, he does not know what happens behind scenes. He just know what he needs to know and the rest is hidden.nidhsbut we can call this data members by their functions.......so how it will be hidden?
Hope it clears it a bit.Are you sure? This action cannot be undone. -
Member • Mar 2, 2013
ya...thanks
but it is also implement in procedural oriented....
if we create add fun and we also can't see actual implementation.....so what is the differentAre you sure? This action cannot be undone. -
Member • Mar 2, 2013
but it is also implement in procedural oriented....
Yup u r right, but that was just an analogy to explain the concept, in OOP data is hidden inside private data members so that even objects cannot directly access it,and require function calls for the same.Are you sure? This action cannot be undone.