Java:
Write a class that had two overloaded static methods for calculating the areas of the following geometric shapes:
circles
rectangles
Here are the formulas for calculating the area of the shapes:
Area of a circle: Area = πr^2
where π is Math.PI and r is the circle's radius
Area of a rectangle: Area = Width * Length
Because the two methods are to be overloaded, they should each have the same name, but different parameter lists. Demonstrate the class in a complete program.
Example run:
run:
The area of a circle with a radius of 20.0 is 1256.64
The area of a rectangle with the length of 10 and width of 20 is 200.00
public class Areas {
public static double area(double radius) {
return Math.PI * radius * radius;
}
public static double area(double width, double length) {
return width * length;
}
public static void main(String[] args) {
System.out.println("The area of a circle with a radius of 20.0 is " + area(20));
System.out.println("The area of a rectangle with the length of 10 and width of 20 is " + area(10, 20));
}
}

Java: Write a class that had two overloaded static methods for calculating the areas of the...