Class Dog
java.lang.Object
|
+--BasicAnimal
|
+--Dog
- All Implemented Interfaces:
- Animal
- public class Dog
- extends BasicAnimal
One of several animal types.
Constructor Summary |
Dog(java.lang.String theName)
Create a new Dog with default characteristics. |
Dog(java.lang.String theName,
double serving,
double weight)
Create a new Dog, 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Dog
public Dog(java.lang.String theName)
- Create a new Dog with default characteristics. This constructor
sets a default meal size of 0.5 pound and an initial weight
of 20 pounds.
- Parameters:
theName
- name of this animal
Dog
public Dog(java.lang.String theName,
double serving,
double weight)
- Create a new Dog, using supplied parameter values.
- Parameters:
theName
- name of this animalserving
- the size of a single meal for this animal in poundsweight
- the initial weight of this animal in pounds
noise
public void noise()
- Provide this animal with an appropriate voice.
main
public static void main(java.lang.String[] args)
- Run this animal through a typical day. This is a simple test harness for this
class.
- Parameters:
args
- ignored