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

Quiz: Polymorphism: questions with answers

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

Take the timed quiz + get a certificate →
  1. Q1. Method overriding is an example of:
  2. Q2. Two methods in the same class named add(int, int) and add(double, double) show:
  3. Q3. What does this print? (code)
  4. Q4. "Duck typing" in Python means:
  5. Q5. Which method lets a + b work for your own Python class?
  6. Q6. You meant to override equals(Object o) but wrote equals(Student s). What did you actually create?
  7. Q7. What does this print? (code)
  8. Q8. What does this print? (code)
  9. Q9. How does Python usually replace method overloading by parameter count?
  10. Q10. Which is the best polymorphic replacement for if type == "circle" ... elif type == "square" ...?