Relative Terms

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.
Historical topic: Java appletsModern web browsers do not run Java applets. The Applet API was deprecated for removal before Java 25 and was removed in Java 26. Treat applet examples on this page as historical object-oriented/GUI examples; for new desktop interfaces use Swing where appropriate or JavaFX/OpenJFX.

Answer:

Is Nissan a child of Automobile? Yes.
Is Nissan the parent of Sentra? Yes.

Relative Terms

A class may be the parent for a child class and may be a child of another class. Just as with human relationships, a person is a child of some humans and a parent to others. The syntax for deriving a child class from a parent class is:

class childClass extends parentClass
{
   // new characteristics of the child class go here
    
}

You have already seen this in creating applets:

class yourApplet extends JApplet
{
  // new characteristics of your applet go here
  
}

The characteristics of applets are inherited from the base class JApplet. This base class contains the details of working with Web browsers, with setting up graphics, and many other things. You get all that automatically by inheritance. All you do is add the additional characteristics you want.

QUESTION 8:

(Thought question:) Can a parent class be one of your own classes (not a predefined class like JApplet)?