What is wrong in these lines in the following code? Makingreference to the line numbers below, briefly indicate the problemand suggest the fix, otherwise mark as "no error".
Line 5:Line 20:Line 21:Line 22:1 public class Circle { 2 private double radius; 3 4 public Circle(double radius) { 5 radius = radius; 6 } 7 8 public double getRadius() { 9 return radius;10 }1112 public double getArea() {13 return radius * radius * Math.PI;14 }15 }1617 class B extends Circle {18 private double length;1920 B(double radius, double length) {21 Circle(radius);22 length = length;23 }24
2526 public double getArea() {27 return getArea() * length;28 }29 }
What is wrong in these lines in the following code? Making reference to the line numbers below, briefly indicate the pro
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am