Rectangles: The shape of things to sum

Report a typo

Fill in the blanks in the code to create a Rectangle class with a method that calculates the area of a rectangle. The main method should call this method and print the result for a rectangle with length 5.0 and width 3.0.

Fill in the gaps with the relevant elements
 class Rectangle {
    public  double calculateRectangleArea(double length, double width) {
        return length * width;
    }
    public static  main(String[] args) {
        System.out.println(calculateRectangleArea(5.0, 3.0));
    }
}
intvoidstaticpublicprivatefinal

Create a free account to access the full topic