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
What is a constructor?
What is method overriding?
What is method overloading?
What is the purpose of getters and setters?
`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?
What does `this` (or `self` in Python) refer to inside an instance method?
Which best describes "inheritance"?
Which problem is inheritance most naturally suited to solve?
What does the `private` access modifier do?
What is the difference between a static method and an instance method?
What does `instanceof` (or its equivalent) tell you?
You have `interface Printable { void print(); }` and `class Receipt implements Printable`. What must `Receipt` do?