Question: public class Circle { private double radius; public Circle ( double r ) { radius = r; } } public class Cylinder extends Circle {

public class Circle
{
private double radius;
public Circle (double r)
{
radius = r;
}
}
public class Cylinder extends Circle {
private double length;
public Cylinder (double r, double l){
Circle (r);
length = l;
}
}
Which of the following is true about the code in class Cylinder above:
Group of answer choices
The second statement in the constructor is invalid.
There is an error in the class because it doesnt have the zero parameter constructor.
The class is fine. It has no errors.
The first statement in the constructor is invalid.

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!