An Introduction to Object-Oriented Programming

By Timothy Budd

Study Guide for Chapter 3

Learning Objectives

After reading this chapter, you should be able to:

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.
  1. From the glossary, find some of the synonyms for the following terms: class, instance, instance variable, method.

  2. What is the difference between type declaration (or definition) and variable instantiation?

  3. What is the definition of an abstract data type? How is an abstract data type related to a class?

  4. What does it mean to say that an object is a combination of state and behavior?

  5. Give examples of classes used as a data manager, a data sink or source, a view class, and a facilitator.

  6. What are some of the reasons for separating a view class from the object being viewed?

  7. What information is contained on the front side of a CRC card, and what information is written on the back side?

  8. Explain some ways in which a class definition in C++ is similar to a structure definition. In what ways are they different?

  9. What is the difference between the public and the private portions of a class description? Why should the public portion be listed first?

  10. Does it make sense for the private portion of a class to be listed in the interface file? Explain why or why not. Why is it required?

  11. What is an inline function in C++? What are some of the advantages of using an inline function? Why not make all functions inline?

  12. In Objective-C, what does the data type id represent?

  13. What is the Smalltalk browser?

  14. In which of the programming languages we described must all new classes be declared as subclasses of an already existing class?

  15. Contrast the encapsulation provided by the class mechanism with the encapsulation provided by the module facility. How are they different? How are they the same? (This question is duplicated in the exercises).

Contents copyright Timothy Budd, 1995.