|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--BasicAnimal | +--Sparrow
One of several animal types.
Field Summary |
Fields inherited from class BasicAnimal |
currentWeight, mealSize, name |
Constructor Summary | |
Sparrow(java.lang.String theName)
Create a new Sparrow with default characteristics. |
|
Sparrow(java.lang.String theName,
double serving,
double weight)
Create a new Sparrow, using supplied parameter values. |
Method Summary | |
static void |
main(java.lang.String[] args)
Run this animal through a typical day. |
void |
noise()
Provide this animal with an appropriate voice. |
void |
sleep()
Provide this animal with a way to rest when weary. |
Methods inherited from class BasicAnimal |
eat, getMealSize, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Sparrow(java.lang.String theName)
theName
- name of this animalpublic Sparrow(java.lang.String theName, double serving, double weight)
theName
- name of this animalserving
- the size of a single meal for this animal in poundsweight
- the initial weight of this animal in poundsMethod Detail |
public void noise()
noise
in interface Animal
noise
in class BasicAnimal
public void sleep()
sleep
in interface Animal
sleep
in class BasicAnimal
public static void main(java.lang.String[] args)
args
- ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |