package interfaceExample2;

public class ExamplePet {
	public static void main(String[] args) {
		Cat cat = new Cat("Garfield");
		
		// animal, pet and cat variables are refering to same object
		
		Animal animal = cat;
		animal.playSound();
		animal.roam();
		
		Pet pet = cat;
		pet.botherMe();
		pet.doTrick();
		cat.botherMe();
		cat.doTrick();
		
		// pet.roam(); INVALID!
		// pet.playSound(); INVALID!
		// animal.doTrick(); INVALID!
	}
}
