What is abstraction in Java?
Why Interviewers Ask This
This is a classic screening question for Java roles. Hiring managers ask it early in interviews to gauge your baseline understanding and determine if you can communicate technical concepts clearly.
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.
Common Mistake
A common mistake is memorizing definitions without understanding implications. When asked this question, go one level deeper — explain what happens when this concept is misused or ignored.