← All topics
Quiz: Inheritance: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which type of inheritance does Java NOT allow with classes?
- Q2. What does this print? (code)
- Q3. Inheritance represents which relationship?
- Q4. How does Python decide which parent method to use in multiple inheritance?
- Q5. "A Car has an Engine" is modelled best with:
- Q6. What does super().init(brand, 2) do in a Python child class?
- Q7. What does this print? (code)
- Q8. class Manager(Employee) and class Intern(Employee) — which type of inheritance is this?
- Q9. In Java, two interfaces both provide a default method start(), and a class implements both. What must the class do?
- Q10. Why are deep inheritance chains (5 or more levels) a problem?