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.
Answer from phnkha on Stack Overflowjava - Difference between Encapsulation and Abstraction - Stack Overflow
Difference between abstraction and encapsulation?
ELI5: The difference between Abstraction and Encapsulation in OOPS
Abstraction is basically the idea that the person who is working with a OOP class only needs to know the key information such as the what is the expected data going in and what is the expected results at the end of the call or what is returned.
So I have a function add(num1, num2) that I know it is expecting two numbers and I expect it to add those numbers together and it will return the result. How the adding is done is irrelevant to me (Abstraction). It also means if I decide to change the code on how the adding is done later, as long as the input and result/output remain the same, everything else in the program should work the same without missing a beat.
Encapsulation is basically the idea that the data within an OOP class will remain in that class and should not effect ANY thing else outside of the class. The data is essentially encapsulated. It is important to note that this also means that the functions data is safe from other functions (with exceptions, and depending on language) so you can always rely on the data being the way the class left it.
TL;DR: Abstraction is not caring how a function does, just what it does.
Encapsulation is knowing as long as the function is working properly, the data should be protected.
More on reddit.comwhat is encapsulation, inheritance, and polymorphism?
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.
This image sums pretty well the difference between both:

Source here
They both have extremely similar definitions. I keep getting conflicting information from the internet that varies from "encapsulation is a subset of abstraction" to "encapsulation is a completely different thing than abstraction".