Programming Examples
Java program to design a class to overload a function area as follows
Design a class to overload a function area() as follows:
- double area(double a, double b, double c) with three double arguments, returns the area of a scalene triangle using the formula:
- double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula:
- double area(double diagonal1, double diagonal2) with two double arguments, returns the area of a rhombus using the formula:
Output