extends.
private).
Examples:
color and since Critter is a subclass of Animal, which is a subclass
of Thing,
all Critters (and all instances of subclasses of Critter)
have a color.
getCell(), all instances of
subclasses of Thing, including Critter, can call this method.
super. For example, in the Animal class
the definition for destroy overrides the definition in
its superclass Thing by first doing what destroy in Thing
does and then doing something additional.
public void destroy() {
super.destroy();
closeMouth();
}
contents which is some kind of Thing:
step which subclasses of Animal, that is, Predator and Critter, must define.
public abstract void step();Note that an abstract method declaration has no body.