public class Owner
{
	private String name;
	private String address;
	private Pet[] pets;		//array of objects (each element represents a particular pet).

	public Owner ()		//default constructor
	{
	}

						//parameterized constructor
	public Owner (String name, String address, Pet[] pets)
	{
		this.name = name;
		this.address = address;
		this.pets = pets;
	}


	public String getName() {return name;}
	public String getAddress() {return address;}
	public Pet[] getPets() {return pets;}			//return all pets

	public void setAddress(String address) {this.address = address;}
	public void setName(String name) {this.name = name;}
	public void setPets(Pet[] pets) {this.pets = pets;} 	 //assign owner an array of pets


		//Loop through pet's array, get a name of each pet, and compare with 'String petName'
		//(parameter passed to this method from another class).
		//Return the pet object (Pet) with a particular name (say, Pet mimi),
		//which is located in element pets[i].

	public Pet getPet(String petName)
	{
		for (int i=0; i<pets.length; i++)
		{
			if (pets[i].getName().equals (petName))
			return pets[i];
		}
		return null;
	}
}





