java.lang.Object | +--Cat
One of several barnyard animals. Note that these animals are similar to, but somewhat different from, the examples I have been giving in class.
Field Summary | |
(package private) double |
currentWeight
the weight of this Cat in pounds. |
(package private) double |
mealSize
the serving size of one meal for this Cat in pounds. |
(package private) java.lang.String |
name
the name of this Cat. |
Constructor Summary | |
Cat(java.lang.String theName)
Create a new Cat with default characteristics. |
|
Cat(java.lang.String theName,
double serving,
double weight)
Create a new Cat, using supplied parameter values. |
Method Summary | |
void |
eat(double pounds)
Eat some goodies. |
double |
getMealSize()
Retrieve the meal size for this Cat. |
java.lang.String |
getName()
Retrieve the name of this Cat. |
static void |
main(java.lang.String[] args)
Run this Cat through a typical day. |
void |
meow()
Provide this Cat with a voice. |
void |
sleep()
Provide this Cat with a way to rest when weary. |
Methods inherited from class java.lang.Object |
|
Field Detail |
double currentWeight
double mealSize
java.lang.String name
Constructor Detail |
public Cat(java.lang.String theName)
theName
- name of this Catpublic Cat(java.lang.String theName, double serving, double weight)
theName
- name of this Catserving
- the size of a single meal for this Cat in poundsweight
- the initial weight of this Cat in poundsMethod Detail |
public void eat(double pounds)
pounds
- the number of pounds of food provided.public double getMealSize()
public java.lang.String getName()
public static void main(java.lang.String[] args)
args
- ignoredpublic void meow()
public void sleep()