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 GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Application Form, GATE Syllabus, GATE Cut off, GATE Previous Year Question Paper, and more.
Also Explore,
- Difference between Abstract Class and Interface in Java
- Difference between Aggregation and Composition in Java
- Difference between Hashset and Treeset in Java
- Difference between == and .equals() method in Java
- Difference between Primitive and Object Data Types in Java
- Difference between Stack and Heap Memory in Java
- Difference between Throw and Throws in Java
- Difference Between Java and Core Java
- Difference Between print() and println() in Java
- Difference Between Java and Python
- Difference between Stack and Heap Memory in Java
- Difference between Static and Final Variable in Java
Comments