Class Mammal

java.lang.Object
  |
  +--Animal
        |
        +--Mammal
All Implemented Interfaces:
Noisy
Direct Known Subclasses:
Dog, Human

public abstract class Mammal
extends Animal
implements Noisy

An abstract class for mammals. All mammals walk and make noise.

Since:
JDK1.2

Constructor Summary
Mammal(java.lang.String name, double weight, java.lang.String food, int legs)
          Creates an awake mammal with a specific name, weight, favorite food, and number of legs;
 
Method Summary
 java.lang.String poke()
          Pokes the mammal, causing it to make a noise.
 java.lang.String toString()
          Returns a string representation of the mammal.
 
Methods inherited from class Animal
feed, getName, getWeight, poop, sleep, wakeup
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Noisy
getNoise
 

Constructor Detail

Mammal

public Mammal(java.lang.String name,
              double weight,
              java.lang.String food,
              int legs)
Creates an awake mammal with a specific name, weight, favorite food, and number of legs;

Method Detail

poke

public java.lang.String poke()
Pokes the mammal, causing it to make a noise.

Specified by:
poke in class Animal
Returns:
the noise made by the mammal

toString

public java.lang.String toString()
Returns a string representation of the mammal. This includes whatever is returned by its superclass toString method, plus the noise it makes, plus however many legs it travels on.

Overrides:
toString in class Animal
Returns:
a string representation of the mammal