Difference between Abstraction and Encapsulation in Java

What is an Abstraction in Java?

An Abstraction is a process of showing all the required items and protecting the rest.

What is Encapsulation in Java?

Encapsulation is the process of binding up data under a single entity.

Difference between Abstraction and Encapsulation in Java

S.No. Abstraction Encapsulation
1 Abstraction is the process of obtaining data. It is the method to receive the information.
2 We can resolve the problems at the interface or design level. We can resolve issues at the execution level.
3 Through abstraction, we can hide unwanted data. Through encapsulation, we can protect the data in a separate entity.
4 We can execute abstraction using interfaces and abstract classes. It can be executed by using an access modifier.

Keep learning and stay tuned to get the latest updates on the GATE Exam along with GATE Preparation Books & GATE Answer Key and more.

Also Explore,

Leave a Comment

Your Mobile number and Email id will not be published.

*

*