+ 5
What is the difference between data encapsulation and data abstraction??
.
2 Antworten
+ 6
Abstraction is about hiding unwanted details while giving out most essential details, while Encapsulation means hiding the code and data into a single unit e.g. class or method to protect inner working of an object from outside world.
+ 1
abstraction is thinking of a object irl and using it to create classes. encapsulation is using classes and methods to make variables secure and inaccesible from outside the class itself. essentially, embedding an attribute or behavior but it can only be accessed indirectly by the class and method being evoked from outside where the variable is declared.