CrazyEngineers
  • Data Hiding In OOP

    nidhs

    nidhs

    @nidhs-EF9dKt
    Updated: Oct 22, 2024
    Views: 872
    hoe data hiding is possible in object oriented approch?give me an example please..........
    0
    Replies
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
  • rahul69

    MemberMar 2, 2013

    nidhs
    hoe data hiding is possible in object oriented approch?give me an example please..........
    For example: private data members of a class are hidden from outside.
    Are you sure? This action cannot be undone.
    Cancel
  • nidhs

    MemberMar 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.
    Cancel
  • rahul69

    MemberMar 2, 2013

    nidhs
    but we can call this data members by their functions.......so how it will be hidden?
    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.
    Hope it clears it a bit.
    Are you sure? This action cannot be undone.
    Cancel
  • nidhs

    MemberMar 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 different
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberMar 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.
    Cancel
Home Channels Search Login Register