Answers to Self-Review Exercises

10.1
  1. switch.

  2. abstract.

  3. concrete.

  4. Polymorphism.

  5. abstract.

  6. downcasting.

10.2
  1. True.

  2. False. An abstract class can include methods with implementations and abstract methods.

  3. False. Trying to invoke a subclass-only method with a superclass variable is dangerous.

  4. False. Only a concrete subclass must implement the method.

  5. True.

Get Java™ How to Program, Seventh 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.