What is Abstraction?
Explore the concept of abstraction in Java's object-oriented programming. Understand how abstraction hides internal details to reduce complexity and focus on essential features. Learn through real-world examples and Java-specific cases how abstract classes and interfaces help achieve this.
Definition
Abstraction in Object-Oriented Programming refers to showing only the essential features of an object to the user and hiding the inner details to reduce complexity. It can be put this way that the user only has to know “what an object does?” rather than “how it does?”.
Real-world examples
The above illustration of the users and the admin of an application is a good real-world example of abstraction.
- A user can only use and interact with the limited features of an application and is unaware of the implementation details or the way the application was developed. Usually, the users are only concerned with the functionality of an application.
- An