As interesting as these descriptions of humans may be, however, they're not very specific. Eunice promised her editor a new story by Friday, so she decides to get down to business. Flipping through the "Humans" binder, she comes to the first chapter, entitled "Villains"




      Villains are based on the idea of humans. They are identical, except that they have some additional qualities, namely a mustache, a hat, a certain "look", some level of drunkenness, and a certain quantity of damsels in their possession. Your standard villain will look mean, start the day out sober, and not yet have captured any damsels.

      Nothing really new here, except that we have peered deeper into Eunice's binders (classes) to see one of the subsections (subclasses). This particular subsection, villains, extended the idea of humans.




      Villain extends the idea of Humans.
      A Vilain
        has a mustache.
        has a hat.
        has a "look".
        has some level of drunkenness.
        has a certain number of damsels tied up.


      For a given Villain,
      He will look mean.
      He will start out sober.
      He will start the day without having any damsels tied up.



      public class Villain extends Humans {
      String mustacheColor;
      String hatColor;
      String look;
      int drunkenness;
      int numberOfDamsels;
      Humans damsel;

      public Villain() {
      look = "Mean";
      drunkedness = 0;
      numberOfDamsels = 0;
      }
      }

      We have introduced here the idea of subclasses. "Humans" was a class, and "Villains" a subclass of it.

      You may also be wondering why Eunice declared "Humans damsel" in this class. Think of it this way. If the villain is going to tie up a damsel, Eunice's editor has to know what a damsel is. By declaring "Humans damsel", her editor will know that a damsel is a type of human.