Answered step by step
Verified Expert Solution
Question
1 Approved Answer
According to the inheritance hierarchy in the following Figure 1, and the provided Shape class and Circle class: Shape - area (double) -color (String) -
According to the inheritance hierarchy in the following Figure 1, and the providedShapeclass andCircleclass:
Shape - area (double) -color (String) - name(String) + Shape(String, String) + getArea(): Double + getName(): String + setColor(String) + calArea( ) +printStr(): String public class Shape { private double area; private String color; private String name; public Shape(String c, String n) { color = c; name = n; } public double getArea() { return area; } - radius (double) Circle + Circle(String, String, double) + getRadius(): double public String getName() { } return name; public void setColor(String c) { color = c; + setRadius(double) } +calArea() +printStr(): String public void calArea() { Figure 1. Inheritance hierarchy area = 0; } public String printStr() { return "name = "I + name + + "color = +color+ " "; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
It seems like the implementation of the Shape and Circle classes is incomplete in the given code sni...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started