public class Animal { private String name; // The human name for the animal, not some secret animal name. private String sound; // What sound does it vocalize? /** Constructor. * @param _name the name of the animal. * @param _sound what sound the animal makes. */ Animal( String _name, String _sound ) { this.name = _name; this.sound = _sound; } /** When the animal wants to bug a human, it says... * @return The sound of the animal, bugging its owner. */ public String speak() { return this.sound + ", " + this.sound + "."; } public String getName() { return this.name; } public String getSound() { return this.sound; } /** A series of tests, constructing subclasses of Animal defined below. */ public static void test1() { System.out.println( "Creating objects and calling methods:" ); System.out.println( new Cat("Bartok").speak() ); //System.out.println( new Python().speak() ); } }