All quizzes
Free quiz · 50 questions in the bank

OOP quiz

Test your OOP knowledge with a free interactive quiz — 50 questions with answers and explanations. No signup needed to play.

Question 1/12Score 0

What are the four classical pillars of OOP?

In this round
  1. What are the four classical pillars of OOP?
  2. Which best describes "abstraction"?
  3. Which statement about constructors is most accurate?
  4. What does it mean that an object has "identity"?
  5. A `BankAccount` class exposes `balance` as a public mutable field, so any code can write `account.balance = -1_000_000`. Which OOP pillar is being broken?
  6. What is the difference between a static method and an instance method?
  7. What is method overriding?
  8. `class Cat extends Animal` and `Animal[] animals = {new Cat(), new Dog()}; for (var a : animals) a.speak();` — which pillar lets each `speak()` produce a different sound?
  9. What is a constructor?
  10. What does `this` (or `self` in Python) refer to inside an instance method?
  11. In `class B extends A { ... }`, calling `new B()` runs which constructor(s)?
  12. What is the purpose of getters and setters?
Gaps to close?
Read the curated OOP notes — core concepts, patterns, interview prep.
OOP notes

More quizzes

AccessibilityAlgorithmsAngularApache KafkaAWSBootstrap