Oops
Oops
Answer: OOP is a programming paradigm based on the concept of "objects", which can
contain data (fields) and code (methods). It promotes code reusability, scalability, and
maintainability.
4. What is Encapsulation?
Answer: Binding data and methods together and restricting direct access using access
modifiers (e.g., private, public).
5. What is Abstraction?
Answer: Showing only relevant details to the user and hiding the internal implementation.
It’s achieved using abstract classes and interfaces.
6. What is Inheritance?
Answer: The process by which one class acquires the properties and methods of another.
● Promotes reusability.
● Helps in hierarchical classification.
7. What is Polymorphism?
Answer: The ability to take many forms.
🔹 Intermediate Concepts
16. What is an Abstract Class?
Answer: A class that cannot be instantiated and may contain abstract methods (without
implementation). Used for partial abstraction.
● Java supports multiple inheritance using interfaces, not classes (to avoid ambiguity).
● S: Single Responsibility
● O: Open/Closed
● L: Liskov Substitution
● I: Interface Segregation
● D: Dependency Inversion