oop - Difference between Encapsulation and Abstraction - Stack Overflow

PHOTO EMBED

Thu Feb 03 2022 16:39:23 GMT+0000 (Coordinated Universal Time)

Saved by @knightastron

Encapsulation hides variables or some implementation that may be changed so often in a class to prevent outsiders access it directly. They must access it via getter and setter methods.

Abstraction is used to hide something too, but in a higher degree (class, interface). Clients who use an abstract class (or interface) do not care about what it was, they just need to know what it can do.
content_copyCOPY

https://stackoverflow.com/questions/15176356/difference-between-encapsulation-and-abstraction