Exercises
10.4 How does polymorphism enable you to program “in the general” rather than “in the specific”? Discuss the key advantages of programming “in the general.”
10.5 What are abstract methods? Describe the circumstances in which an abstract method would be appropriate.
10.6 How does polymorphism promote extensibility?
10.7 Discuss three proper ways in which you can assign superclass and subclass references to variables of superclass and subclass types.
10.8 Compare and contrast abstract classes and interfaces. Why would you use an abstract class? Why would you use an interface?
10.9 (Java SE 8 Interfaces) Explain how default
methods enable you to add new methods to an existing interface without breaking the classes that implemented the ...
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.