An Introduction to Object-Oriented Programming
By Timothy Budd
Study Guide for Chapter 10
Learning Objectives
After reading this chapter, you should be able to:
-
Describe the difference between static and dynamic typing, and some of the
advantages and disadvantages of the two techniques.
-
Describe the difference between static and dynamic method binding, and
how this concept is distinguished from static and dynamic typing.
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 in this chapter.
- What is a binding time? Give examples of a few different binding
times.
- What does it mean to say a programming language is statically typed?
What are some advantages of a statically typed language?
- What is a static class? How does it differ from a dynamic class?
- What does it mean to say a programming language is dynamically typed?
What are some advantages of a dynamically typed language?
- Why is the principle of substitutability not a relevant concept in
dynamically typed programming languages?
-
What is the problem of reverse polymorphism?
- What is dynamic method binding, and how does it differ from
dynamic typing?
- In which of the programming languages studied is it possible to take
a value and determine its dynamic class?
- In which languages is it possible to perform reverse polymorphism; that is,
take a value from a parent class and assign it to a variable declared as
an instance of a child class? Why is this not an issue in dynamically
typed languages. In the languages in which it is permitted, how can it be
performed in a type-safe manner (that is, ensuring that type errors can not
occur)?
- What are some of the arguments in favor of static binding and against
dynamic binding? In favor of dynamic binding and against static binding?
Contents copyright
Timothy Budd, 1995.