public class MyPets
{
	public static void main (String[] args)
	{
		Animal[] pets = new Animal[3];

		Animal fred = new Cat();

		Cat oliver = new Cat();
		Dog cole = new Dog();
		Dog rufus = new Dog();

		pets[0] = oliver;
		pets[1] = cole;
		pets[2] = rufus;

		for (int i=0; i<pets.length; i++)
		{
			System.out.println 	("I am a " + pets[i].getType());
			System.out.println 	("I eat " + pets[i].eat());
			System.out.println 	("I like to " + pets[i].activity());
			System.out.println 	("I say " + pets[i].makeNoise());


						//Determine whether current Animal is a dog
			if (pets[i] instanceof Dog)
			{
						//Downcast Animal reference to Dog reference
				Dog temp = (Dog)pets[i];

						//Invoke method from Dog class
				((Dog)pet[i]).eat();
				//temp.eat();
				//System.out.println (temp.fetch("ball"));
			}
		}

/*		System.out.println 	("I am a " + cole.getType());
		System.out.println 	("I eat " + cole.eat());
		System.out.println 	("I like to " + cole.activity());
		System.out.println 	("I say " + cole.makeNoise());
*/	}
}
