Abstraction and Encapsulation look very similar in terms of meaning, especially as they relate to object-oriented programming. Both concepts are often considered to be inseparable. However, let's check their meanings and see if there are some differences between the two concepts.
Abstraction simply refers to a concept used in oop, which helps in concealing or hiding certain details that are considered irrelevant so as to eliminate redundancy and enhance efficiency. On the other hand, encapsulation simply refers to a mechanism that helps in enclosing data and information as if they are wrapped in a capsule in order to prevent unnecessary interference with the data or information.
While abstraction is just a way of hiding irrelevant details, encapsulation is trying to hide certain data or information so as to restrict people from accessing it. Interface and abstract class are usually used to implement abstraction, while encapsulation is mostly implemented using modifiers that require private access.