/**
 * A licensed dog.
 * 
 * @author Drue Coles
 */
public class Dog extends Pet {

    private final int licence;

    /**
     * Creates a dog with a given name and license number.
     */
    public Dog(String name, int licence) {
        super(name);
        this.licence = licence;
        System.out.println("TESTING: in Dog constructor.");
    }
    
    /**
     * Makes a dog sound.
     */
    @Override
    public void speak() {
        System.out.println("Woof!");
    }
    /**
     * Returns a greeting from this this dog.
     */
    @Override
    public String toString() {
        return super.toString() + " I am a dog. My license number is " + 
                licence + ".";
    }
    
    /**
     * Outputs a fetching-stick alert.
     */
    public void fetchStick() {
        System.out.println(name + " the dog is fetching a stick.");
    }
    
    public static void main(String[] args) {
        Dog dog = new Dog("Jupiter", 12345);
        System.out.println(dog);
        dog.speak();
        dog.fetchStick();
    }
}