Question: Given a class named Dog.java Extend this class 5 times, using a different dog breed (pick your favorite breeds) Breed #1: must use default name

Given a class named Dog.java

Extend this class 5 times, using a different dog breed (pick your favorite breeds)

Breed #1: must use default name and override at least 1 other (different) feature/method

Breed #2: must use default bark and override at least 1 other (different) feature/method

Breed #3: must use default size and override at least 1 other (different) feature/method

Breed #4: must use default color and override at least 1 other (different) feature/method

Breed #5: must use default speed and override at least 1 other (different) feature/method

Write a Driver to demo all breeds

public class Dog { private String name; private final int speed = 5; // default speed in mph private final double height = 125.0; // default color private final String size = "Normal"; // default size private final String color = "White"; // default color public Dog() { name = "Chance"; } public Dog(String name) { this.name = name; } public String getName() { return name; } public String bark() { return "Woof"; } public String getColor() { return color; } public int getSpeed() { return speed; } public double getHeight() { return height; } public String getSize() { return size; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!