Boy, it all makes sense except that bit about that "public String whatIsYourName()" business, eh? Don't worry. We'll get to all that in just a little bit.
As interesting as these descriptions of humans may be, however, they're not very specific. Laura 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 Laura'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;
}
}
|