Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
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