Exercise Set 4

  1. In functional programming, you create a type whose members have several different forms in a type definition, listing all of the forms. How do you create a type (or class) with many different forms in object-oriented programming?

  2. What is a virtual function?

  3. What is the difference between a concrete class and an abstract class?

  4. In object-oriented programming, you imagine that objects carry functions with them. Yet, the functions are not really stored with the objects. How does an object locate its functions? How does it know which functions to select? What is the name of the system support that is responsible for locating functions?

  5. What is the difference between single inheritance and multiple inheritance?

  6. In a single-inheritance language, is there a limit on the number of base classes that a class can have?

  7. How does a single-inheritance object-oriented system know where to look for inherited data fields in an object?

  8. To which classes is a protected data field visible? How does a protected data field differ from a private data field?

  9. Is a private data field of an object accessible ONLY to that one object, or is it possible for other objects to access it directly?