🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Inheritance, ABC and MRO: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What happens when you try to create an object of a class that still has an unimplemented abstract method?
  2. Q2. Can an abstract base class contain normal (non-abstract) methods?
  3. Q3. What does this print? (code)
  4. Q4. What is the MRO?
  5. Q5. What does this print? (code)
  6. Q6. Inside a method of class B, what does super() refer to when the object is a D (with MRO D, B, C, A)?
  7. Q7. Why should classes in a diamond call super().method() instead of A.method(self)?
  8. Q8. What is a mixin?
  9. Q9. A Library has many Books. Which design fits best?
  10. Q10. What does this print? (code)