CHAPTER 51 — Abstract Classes and Polymorphism

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

creation: 2/14/99; revisions: 2/25/99, 7/17/99, 01/24/00, 07/28/2002, 06/05/03

CHAPTER 51 — Abstract Classes and Polymorphism

Classes in a hierarchy are related by the is-a relationship. For example, a Nissan is-a Automobile, and a Sentra is-a Nissan. This chapter discusses how reference variables are used for objects from different classes within a hierarchy. Another subject is the idea of an abstract class — a class that cannot be instantiated but that can be the parent of other classes.

Chapter Topics:

  • Abstract Classes
  • Abstract Methods
  • Polymorphism

QUESTION 1:

How many Valentine cards did you get this year?