Polymorphism

36 MCQs

MCQs

36 questions · 30 min · 36 marks

Want to try first? Take the free Computer Science test: Networks Basics

Sample questions

The first 5 of 36. Try each one, then tap to see the answer.

  1. Question 1

    Polymorphism in OOP is best defined as:

    • AAllowing an object to take multiple forms through method overriding
    • BHiding data inside a class for security
    • CUsing multiple inheritance to extend classes
    • DEnsuring that each class has only one method
    Show answer

    Answer: A

    Polymorphism lets the same method behave differently in different objects.

  2. Question 2

    Polymorphism literally means:

    • AMany levels
    • BMany forms
    • CMany files
    • DMany classes
    Show answer

    Answer: B

    Polymorphism means many forms.

  3. Question 3

    Polymorphism allows the same method or function or operator to:

    • ABe deleted at runtime
    • BHide its data
    • CBe used only once
    • DBehave differently depending on the object
    Show answer

    Answer: D

    The same method can act differently depending on the object it works with.

  4. Question 4

    In the payment example all payment types share:

    • AOne method name with different implementations
    • BOne implementation with different names
    • CNo common method
    • DOne class for every payment
    Show answer

    Answer: A

    All payment types use processPayment() but each implements it differently.

  5. Question 5

    In the payment example the method name stays the same but the action changes based on:

    • AThe payment amount
    • BThe customer name
    • CThe payment type
    • DThe server speed
    Show answer

    Answer: C

    Each payment type performs its own action.

More tests in Object Oriented Programming Using Python

Practise with a free account

Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.

Create free account