Beginner Compilers & Programming Language Theory
Q32 / 100

What is polymorphism in type systems?

Correct! Well done.

Incorrect.

The correct answer is B) The ability of code to work with values of multiple types — parametric (generics), ad-hoc (overloading), and subtype (inheritance) polymorphism

B

Correct Answer

The ability of code to work with values of multiple types — parametric (generics), ad-hoc (overloading), and subtype (inheritance) polymorphism

Explanation

Parametric (List<T> works for any T), ad-hoc (+ works for int, float, string via overloading), subtype (Cat behaves as Animal). Strachey's 1967 classification. Related: type classes (Haskell), traits (Rust).

Progress
32/100