☕ Java
Beginner
What is abstraction in Java?
Answer
Abstraction is the OOP principle of exposing only the essential features of an object while hiding the internal implementation details. It lets users interact with a simplified interface without needing to understand the underlying complexity. In Java, abstraction is achieved through abstract classes and interfaces. For example, when you call list.add(item), you don't need to know whether the underlying implementation is an ArrayList or LinkedList — the interface hides those details. Abstraction reduces complexity, increases code maintainability, and allows implementation to change without affecting the user of the interface.