public class Dog extends Animal{ private String earShape; private String tailShape; public Dog(){ super("Mutt","Big",50); } public Dog(String type, double weight){ this(type,weight,"Perky","Curled"); } public Dog(String type, double weight, String earShape, String tailShape) { super(type, weight < 15 ? "small" : (weight < 35?"Medium":"large"), weight); this.earShape = earShape; this.tailShape = tailShape; } @Override public String toString() { return "Dog{" + "earShape='" + earShape + '\'' + ", tailShape='" + tailShape + '\'' + "} " + super.toString(); } public void makeNoise(){ if (type == "Wolf"){ System.out.println("Ow woooo! "); } bark(); System.out.println(); } @Override public void move(String speed) { super.move(speed); // System.out.println("Dogs walk, run and wag their tails"); if (speed=="slow"){ walk(); wagTail(); }else { run(); bark(); } System.out.println(); } private void bark(){ System.out.println("woof!"); } private void run(){ System.out.println("Dog Running"); } private void walk(){ System.out.println("Dog walking"); } private void wagTail(){ System.out.println("Tail Waging"); } }