Consider the following class hierarchy: public final class S…

Consider the following class hierarchy: public final class Shape { private String mycolor; public Shape(String mycolor) { this.type = mycolor; } public String getColor() { return mycolor; } } public class Triangle extends Shape { public Triangle(String mycolor) { super(mycolor); } } } What is wrong with this class hierarchy definition?

Consider the following class hierarchy: public final class S…

Consider the following class hierarchy: public final class Shape { private String mycolor; public Shape(String mycolor) { this.type = mycolor; } public String getColor() { return mycolor; } } public class Triangle extends Shape { public Triangle(String mycolor) { super(mycolor); } } } What is wrong with this class hierarchy definition?