java.lang.Object | +--PetSet
This class is a collection of animals of various types. It manages the collection by having all the various animals do various things upon request.
Field Summary | |
(package private) Cat |
catA
first Cat |
(package private) Cat |
catB
second Cat |
(package private) Dog |
dogA
a Dog |
Constructor Summary | |
PetSet()
This default constructor creates the set of animal objects, as specified in the homework writeup. |
Method Summary | |
void |
dine()
Everybody in the set eats a large meal. |
static void |
main(java.lang.String[] args)
This is a simple test harness for this class. |
void |
sleep()
Everybody in the set sleeps it all off. |
void |
snack()
Everybody in the set eats a small meal. |
void |
speak()
Everybody make some noise, it's time to get a move on! |
Methods inherited from class java.lang.Object |
|
Field Detail |
Cat catA
Cat catB
Dog dogA
Constructor Detail |
public PetSet()
Method Detail |
public void dine()
public static void main(java.lang.String[] args)
args
- ignoredpublic void sleep()
public void snack()
public void speak()