Is-a Relationship

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.

Answer:

No. Inheritance goes in only one direction.

Is-a Relationship

ford isa automobile

The picture shows a parent class and a child class. The line between them shows the "is-a" relationship. The arrow points to the parent class from the child class. The picture can be read as "a Ford is-a automobile."

The phrase "is-a" is in common use in computer science. The arrow between a child and parent is sometimes called an "is-a link".

The clouds represent classes. This picture does not show objects.

Inheritance is between classes, not between objects.

A parent class is a blueprint that is followed when an object is constructed. A child class of the parent is another blueprint (that looks much like the original), but with added features. The child class is used to construct objects that look like the parent's objects, but with added features.

QUESTION 5:

How many objects of a given class can be constructed? (Hint: how many houses can be build from one blueprint?)