package Classes; public class DogHarness { public static void main(String[] args) { // set up dogs and cat Dog fido = new Dog(); fido.name = "fido"; Dog rover = new Dog(); rover.name = "rover"; Cat fluffy = new Cat(); fluffy.catname = "Fluffy"; // mutual friends, and an enemy fido.myFriend = rover; rover.myFriend = fido; fido.enemy = fluffy; // behavior methods fido.fetch(); fido.fetch(); fido.fetch(); fido.gainSticks(); fido.loseSticks(); fido.chaseCat(); // using methods through instance vars fido.myFriend.bark(); // created this bunny just in time to eat it // bunny's name is null, that's okay, it's getting eaten fido.enemy.eat(new Bunny()); //printing, notice we don't have to say .toString System.out.println(fido); // printing friends and enemies System.out.println(fido.myFriend); System.out.println(fido.enemy); // since they are mutual friends, we can go around in a circle System.out.println(fido.myFriend.myFriend); } }