Exercise Set 4
- 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?
- What is a virtual function?
- What is the difference between a concrete class and
an abstract class?
- 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?
- What is the difference between single inheritance
and multiple inheritance?
- In a single-inheritance language, is there a limit on
the number of base classes that a class can have?
- How does a single-inheritance object-oriented system
know where to look for inherited data fields in an object?
- To which classes is a protected data field visible?
How does a protected data field differ from a private data field?
- 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?