Polymorphism, OOP Exercise

A: Explain what the difference is between the concept of polymorphism and concept of dynamic binding. Why is polymorphism a pre request for dynamic binding?

B: Exercise 7.1 in the book. The topic is method redefinition in subclasses.

C: Exercise 7.6 in the book. The topic is inheritance and overwriting methods.

D: In an abstract class it is possible to have concrete methods, i.e., methods with a body (and naturally abstract methods). List the advantages and disadvantages of being able to have concrete methods in abstract classes.

E:  Exercise 7.7 in the book. The topic is abstract classes.

Extra Assignments

E1: Exercise 7.10. The topic is initialization order in inheritance hierarchies.

E2: Create a class with two methods setup() and teardown(). Make an inheritance hierarchy that is three levels deep. In the derived classes implement the setup() method such that it is called in a general-to-specific order. Implement the teardown() method such that it is called in a specific-to-general order.

Best regards,
Kristian Torp