Class Dog

java.lang.Object
  |
  +--BasicAnimal
        |
        +--Dog
All Implemented Interfaces:
Animal

public class Dog
extends BasicAnimal

One of several animal types.


Fields inherited from class BasicAnimal
currentWeight, mealSize, name
 
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 BasicAnimal
eat, getMealSize, sleep, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 animal
serving - the size of a single meal for this animal in pounds
weight - the initial weight of this animal in pounds
Method Detail

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