Interview Q&A / Object-Oriented Programming
Object-Oriented Programming interview questions
The four pillars, interfaces, abstract classes and design basics.
Prefer rapid revision? Practise Object-Oriented Programming short interview answers →
- How do you achieve abstraction in Java?
Use abstract classes (partial implementations with abstract methods) or interfaces (pure contracts). Callers depend on the abstract type and never see the concrete class behind it.
BeginnerQuick answer1 min read - What is the difference between abstraction and encapsulation?
Abstraction decides what to show: it exposes a simple view and hides complexity. Encapsulation decides how to protect: it bundles data with methods and restricts access to it.
BeginnerQuick answer1 min read