Question: public abstract class Shape I public abstract double perimeter ( ) ; public abstract double area ( ) ; ( d ) Solution public class

public abstract class Shape I
public abstract double perimeter();
public abstract double area();
(d) Solution
public class Circle extends Shape ||
private double radius;
public double perimeter() I
return 2* Math.PI * radius;
}
public double area 0(
return Math.PI * radius * radius;
1
1
(e) Solution
public class Rectangle extends Shape {
private double length, width;
public double perimeter()(
return 2*(length + width);
I
public double area()(
return length * widtht;
What is abstract class shape means ?
 public abstract class Shape I public abstract double perimeter(); public abstract

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!