Question: Given the following superclass and its subclass, which line would return an error? Superclass: public class Shape public class Triangle extends Shapef public double base,

 Given the following superclass and its subclass, which line would return

Given the following superclass and its subclass, which line would return an error? Superclass: public class Shape public class Triangle extends Shapef public double base, height private int numSides; public double area; ublic Triangle) public Shape(int n) super(3); base0 height 0; area0 public Triangle(double b, double h) super; height h; public double calcArea) public double calcArea) return area; public void showData) System.out.printin("The number of sides is "+num sides); return area-0.5 base height return area; public void showData) super.showData(): System.out.printin( The base is "+base); System.out.printin("The height is"+ height); Select... Select... super(3); public Triangle(double b, double h) superO; super.showData0

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!