Question: What is wrong with the following code? Correct it. public class Circle{ private double radius; public Circle(double radius){ radius = radius; } public double getArea(){
What is wrong with the following code? Correct it.
public class Circle{
private double radius;
public Circle(double radius){
radius = radius;
}
public double getArea(){
return radius* radius*Math.PI;
}
class B extends Circle{
private double length;
B(double radius, double length)
{
Circle(radius);
length = length;
}
public double getArea(){
return getArea()*length;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
