Hierarchy of Interfaces

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. private would mean that nobody could use it, which is not sensible.

Hierarchy of Interfaces

An interface can be an extension of another interface (but not an extension of a class):

public interface ExciseTaxable extends Taxable
{
  double extraTax = 0.02;
  double calculateExtra();
}

A complex hierarchy of interfaces can be constructed using this feature. This is an advanced feature which you will probably not need to use.

QUESTION 24:

Can a class extend an interface?