package inheritAnimals; public class Budgie extends Pet{ // constructors not inherited, need to write my own public Budgie() { // super() happens automatically setName("pretty bird"); } // override // change how makeNoise works public void makeNoise() { System.out.println(getName() + " goes tweet."); } // overload // budgie repeats a sound it hears some number of times public void makeNoise(String sound, int times){ for (int i = 0; i < times; i++) { System.out.println(getName() + " repeats " + sound); } } // add behavior not all Pets have public void fly() { System.out.println(getName() + " flies around"); } // overriding toString @Override public String toString() { return "a budgie called " + getName() + " (age " + getAge() + ")"; } }