posted 22 years ago
In the end, if something has-a whatever, there must be a place to keep that whatever. Therefore there must be a variable somewhere to keep the information for what it has.
In 4 the Animal has-a Species. The class has the information for the species and stores it in a variable of type Species. If it had read
public class Animal extends Species{}
then it would "be-a" Species.
In 5 it has-a Component array named children.
"JavaRanch, where the deer and the Certified play" - David O'Meara