Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

May 6, 2010

What the difference between data hiding and abstraction?

Data hiding means, hiding some essential information or as you say a data from other end user or users and abstraction in simple language means hiding complex features and showing only essential features of any object.

In data hiding we hide the information by using access specifier private, public and protected..so it means we are hiding info from outside the world.But in abstrastion we express only essential feature..
Eg: Three set of customers are going to buy a bike First one wants information about the style. Second one wants about the milage. Third one wants the cost and brand of the bike.So the salesperson explains about the product which customer needs what. So he hiding some information and giving the revelant information.

No comments: