An Introduction to Object-Oriented Programming
By Timothy Budd
Study Guide for Chapter 14
Learning Objectives
After reading this chapter, you should be able to:
-
Describe the different manifestations of polymorphism encountered in
object-oriented programming langauges.
-
Distinguish between overloading and overriding, and between overriding and
deferred methods.
-
Illustrate some of the uses of polymorphism in problem solving.
Study Questions
You may wish to use the print or save as command
on your web browser to produce a copy of this study guide.
That way you can fill in the answers to the questions as part of
your assimilating the information you learn as you read the material.
-
In common usage, what does it mean for a concept to be polymorphic?
-
Why are functions with polymorphic arguments easier to write in dynamically
typed langauges than in statically typed languages?
-
Why is it difficult to write a general purpose utility, such as a function
to compute the number of elements in a linked list, in a strongly-typed
language such as Pascal?
-
What is a polymorphic variable?
-
What do we mean when we say a function name is overloaded?
-
What is the difference between overloading the coersion?
-
What are the three different ways in which a programming language
could implement the addition operation?
-
Why is the ability to overload function names not as confusing to the
programmer as it would be if all functions were required to have
unique names?
-
What is parametric overloading, how does it differ from overloading
of method names from separate classes?
-
What is overriding, and how does it differ from overloading?
-
What is a deferred method?
-
What is pure polymorphism?
-
Why are polymorphic procedure often not as efficient as non-polymorphic
variations? Why should this loss in efficiency not be a great concern?
Contents copyright
Timothy Budd, 1995.