+ 4

What is the actual difference between abstraction and encapsulation? Please explain with real life example

16th Jan 2017, 1:24 PM
Gayatri
3 Answers
+ 6
abstraction is providing only the overview but not the implementation details. For example ,a customer is provided only necessary information about how to drive a car but not about the different parts and working. where as encapsulation is binding up of classes so as to protect them against unauthorised access. For example bank lockers which can be accessed only by authorized person.
18th Jan 2017, 3:23 PM
Himanshu Dugar
+ 1
as far above mentioned 👆abstraction is providing only the overview but not the implementation details. For example ,a customer is provided only necessary information about how to drive a car but not about the different parts and working. while encapsulation refers to hiding the information that you do not want to provides to the main program directly
5th Mar 2017, 6:23 AM
mudang
mudang - avatar
0
thanks....It's really easy to understand
18th Jan 2017, 3:24 PM
Gayatri