Polymorphism

0.0(0)
Studied by 1 person
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:31 PM on 6/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards

What is polymorphism?

The ability to treat values, objects, or functions of different types in a uniform way while allowing different behaviors

2
New cards

What are the two main categories of polymorphism?

  • Ad-hoc polymorphism

  • Universal polymorphism


3
New cards

What are the two forms of ad-hoc polymorphism?

  • Coercion

  • Overloading


4
New cards

What is coercion polymorphism?

Automatic conversion from one type to another.

Example: int -> double or double -> int

5
New cards

What is overloading polymorphism?

Using the same function or operator name with different parameter lists

6
New cards

What are the two forms of universal polymorphism?

  • Inclusion

  • Parametric


7
New cards

What is inclusion polymorphism?

Using inheritance and virtual functions so different derived objects can be treated through a common base class

8
New cards

How is inclusion polymorphism commonly implemented?

Using base-class pointers or references that point to derived-class objects

9
New cards

What operator is commonly used to invoke late binding through a base-class pointer?

ptr->virtualFunction();


10
New cards

What is parametric polymorphism?

Polymorphism implemented using templates so the same code works with many types

11
New cards

What are the benefits of templates?

  • Code reuse

  • Type safety

  • Less repetitive code


12
New cards

What is early binding (static binding)?

Function calls are resolved at compile time

13
New cards

What is late binding (dynamic dispatch)?

Function calls are resolved at runtime

14
New cards

Which polymorphism types use early binding?

  • Coercion

  • Overloading

  • Parametric polymorphism


15
New cards

Which polymorphism type uses late binding?

Inclusion polymorphism