0

Basic difference between encapsulation and abstraction

Java

22nd Jan 2018, 8:16 AM
Sumit Kumar
Sumit Kumar - avatar
3 Antworten
+ 9
Encapsulation is wrapping, just hiding properties and methods. Encapsulation is used for hide the code and data in a single unit to protect the data from the outside the world. Encapsulation=data hiding+abstraction Abstraction is the hiding of internal structure and just highlighting set of services. https://www.youth4work.com/Talent/Aptitude/Forum/118365-difference-between-encapsulation-and-abstraction https://stackoverflow.com/questions/742341/difference-between-abstraction-and-encapsulation
22nd Jan 2018, 8:21 AM
Scooby
Scooby - avatar
+ 1
So abstraction is a part of encapsulation?
22nd Jan 2018, 9:44 AM
Sumit Kumar
Sumit Kumar - avatar
0
Data abstraction focuses on defining the interface and behavior of objects at a higher level, while data encapsulation focuses on bundling data and methods together and controlling access to that data. Abstraction deals with the overall design and functionality, while encapsulation deals with the implementation details and data protection. Both concepts play important roles in creating robust and maintainable object-oriented systems. https://net-informations.com/faq/oops/encapsulation.htm
6th Jun 2023, 5:23 AM
rahul kumar
rahul kumar - avatar