package InheritanceDemo; /** * Mouse.java * * * Created: Mon Feb 5 14:43:50 2001 * * @author */ public class Mouse extends Animal{ /** * Constructs a mouse with the given name, * and specifies that its food is cheese. * * @param name This animal's name. */ public Mouse (String name){ super(name); food = "cheese"; } /** Prints a message showing this animal moving by scampering. */ public void move(){ System.out.print("Scamper scamper scamper "); } /** Prints a message showing this animal speaking by squeeking. */ public void speak(){ System.out.print("Squeak "); } public String toString(){ return name + " Mouse"; } }// Mouse