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/5Score 0

What is a constructor?

Questions in this quiz
  1. What is a constructor?
  2. What is method overriding?
  3. What is method overloading?
  4. What is the purpose of getters and setters?
  5. `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?
  6. What does `this` (or `self` in Python) refer to inside an instance method?
  7. Which best describes "inheritance"?
  8. Which problem is inheritance most naturally suited to solve?
  9. What does the `private` access modifier do?
  10. What is the difference between a static method and an instance method?
  11. What does `instanceof` (or its equivalent) tell you?
  12. You have `interface Printable { void print(); }` and `class Receipt implements Printable`. What must `Receipt` do?
Gaps to close?
Read the curated OOP notes — core concepts, patterns, interview prep.
OOP notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web