java.lang.ObjectPenguin
public class Penguin
Constructor Summary | |
---|---|
Penguin(double _height)
Construct a penguin with the given height. |
Method Summary | |
---|---|
void |
eatFish(int numHerrings)
Make this penguin taller, based on how many fish it eats. |
double |
getHeight()
Return this Penguin's height (in cm). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Penguin(double _height)
_height
- The height for this penguin, in cm (centimeters).Method Detail |
---|
public void eatFish(int numHerrings)
numHerrings
- The number of fish eaten.
Each fish makes it 0.1cm taller.public double getHeight()