Whats the key difference btwn Data encapsulation and Data abstraction ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Whats the key difference btwn Data encapsulation and Data abstraction ?

I had an interview today @ williamslea and had the above question.I gave a detailed explanation bt he was not convinced. myself too felt so confused abt dat! I go through different sites bt not get what i want. Can u people help me plz!

27th Jun 2017, 5:59 PM
Rose
Rose - avatar
10 Answers
+ 7
@BenjiSolo Yah..i think abstraction s more generic term dan encapsulation. Encapsulation s jzt a part f abstraction.
14th Jul 2017, 1:08 PM
Rose
Rose - avatar
+ 6
Thanku🌹@BenjiSolo @Kalyan Kondapalli @ Hassam Usmani
14th Jul 2017, 12:07 PM
Rose
Rose - avatar
+ 5
@BenjiSolo In that discussion n stackoverflow i saw a phrase "Abstraction is just opposite of Encapsulation", can u explain it more clearly?
14th Jul 2017, 12:15 PM
Rose
Rose - avatar
+ 5
"The essence of abstraction is to extract essential properties while omitting inessential details"-"In encapsulation the data and its code are put together in a package or capsule."- Is this they meant by opposite functionality?
14th Jul 2017, 12:36 PM
Rose
Rose - avatar
+ 2
any other ans.!?
29th Jun 2017, 6:22 PM
Rose
Rose - avatar
30th Jun 2017, 9:11 AM
BenjiSolo
BenjiSolo - avatar
+ 2
stackoverflow is the best site different types of codes and examples...u can search there....it very helpful
2nd Jul 2017, 6:31 PM
Kalyan Kondapalli
Kalyan Kondapalli - avatar
14th Jul 2017, 11:00 AM
Hassam Usmani
Hassam Usmani - avatar
+ 2
Hi @RozeS. I saw it also. but I start saying that, has i understand things, encapsulation is a part of abstraction, so it can't be opposite, but instead complementaries.. However, if i try to understand what the guy said, since Abstraction consist of showing details(methods, variables..) usefull for the creation and the manipulation of objects, and then by encapsulating objects, we're effectively hiding those details of their implementations that are not really necessary for every body to know(for them not to be modified by any other unwanted user), we can see this as if both are opposite. Finally Encapsulation is the medium used to choose wich thing is better to be hidden,and wich one can be visible, for the Abstraction to be realised.
14th Jul 2017, 1:00 PM
BenjiSolo
BenjiSolo - avatar