Class Walrus

java.lang.Object
  extended by Walrus

public class Walrus
extends Object


Constructor Summary
Walrus(int numWhiskers)
          Construct a walrus with an initial weight of 50kg.
 
Method Summary
 void eatAPenguin()
          Eat one penguin.
 double getWeight()
          Return the weight of this walrus, in kg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Walrus

public Walrus(int numWhiskers)
Construct a walrus with an initial weight of 50kg.

Parameters:
numWhiskers - The number of whiskers this new Walrus has.
Method Detail

eatAPenguin

public void eatAPenguin()
Eat one penguin. Increases this Walrus's weight by 1.0kg.


getWeight

public double getWeight()
Return the weight of this walrus, in kg.

Returns:
the weight of this walrus, in kg.