import java.util.ArrayList;

public class Kennel
{
  private ArrayList petList; // all elements are references
                            // to Pet objects

  public Kennel(ArrayList pets)
  {
    petList = pets;
  }

  // postcondition: For each Pet in the kennel, its name followed
  //                by the result of a call to its speak method
  //                has been printed, one line per Pet.
  public void allSpeak()
  {
    for(int k = 0; k < petList.size(); k++)
    { Pet p = (Pet)petList.get(k);
      System.out.println(p.getName() + " " + p.speak());
    }
  }
}
