Class Robin

java.lang.Object
  |
  +--Animal
        |
        +--Bird
              |
              +--Robin
All Implemented Interfaces:
Noisy

public class Robin
extends Bird
implements Noisy

A class for robins. A robin is a bird that makes a "Tweet" noise.

Since:
JDK1.2

Constructor Summary
Robin(java.lang.String name)
          Creates a robin.
 
Method Summary
 java.lang.String getNoise()
          Gets the noise made by a robin.
 java.lang.String poke()
          Pokes the robin, causing it to make a noise.
 java.lang.String toString()
          Returns a string representation of the robin.
 
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
 

Constructor Detail

Robin

public Robin(java.lang.String name)
Creates a robin. Robins weigh 0.25 kilograms and eat birdseed.

Parameters:
name - the robin's name ("Robby", "Sally", etc.)
Method Detail

getNoise

public java.lang.String getNoise()
Gets the noise made by a robin. Robins go "Tweet".

Specified by:
getNoise in interface Noisy
Returns:
the noise

poke

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

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

toString

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

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