java.lang.ObjectWalrus
public class Walrus
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 |
---|
public Walrus(int numWhiskers)
numWhiskers
- The number of whiskers this new Walrus has.Method Detail |
---|
public void eatAPenguin()
public double getWeight()