ENCAPSULATION VS ABSTRACTION

abstract vs encapsulation in java

Abstraction and Encapsulation in Java are two important Object oriented programming concept and they are completely different to each other.

Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse.

Abstractionis the concept of hiding irrelevant details.In other words make complex system simple by hiding the unnecessary detail from the user.

Abstraction is implemented in Java using interface and abstract class while Encapsulation is implemented using private, package-private and protected access modifier.