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:

  1. double area(double a, double b, double c) with three double arguments, returns the area of a scalene triangle using the formula:
  2. double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula:
  3. double area(double diagonal1, double diagonal2) with two double arguments, returns the area of a rhombus using the formula:
Output

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz