Java Program to Find Area of Rectangle Using Method Overloading Last Updated : 08 Sep, 2022 Comments Improve Suggest changes Like Article Like Report A rectangle is a simple flat figure in a plane. It has four sides and four right-angles. In a rectangle all four sides are not of equal length like a square, sides opposite to each other have equal length and both the diagonals of the rectangle have equal length. Method overloading allows different methods to have the same name, but different signatures where the signature can differ by the number of input parameters or type of input parameters or both. In this article, we will learn how to find the area of the rectangle using the method overloading. Area of the RectangleThe area of the rectangle is the product of its length and width/breadth. We can simply calculate the area of the rectangle using the following formula: Formula: Area of the rectangle: A = S * THere, S is the length of the rectangle and T is the breadth/width of the rectangle. Below is the implementation of the above approach: Java // Java program to find the area of // the rectangle using Method Overloading import java.io.*; class Rectangle { // Overloaded Area() function to // calculate the area of the rectangle // It takes two double parameters void Area(double S, double T) { System.out.println("Area of the rectangle: " + S * T); } // Overloaded Area() function to // calculate the area of the rectangle. // It takes two float parameters void Area(int S, int T) { System.out.println("Area of the rectangle: " + S * T); } } class GFG { // Driver code public static void main(String[] args) { // Creating object of Rectangle class Rectangle obj = new Rectangle(); // Calling function obj.Area(20, 10); obj.Area(10.5, 5.5); } } OutputArea of the rectangle: 200 Area of the rectangle: 57.75 Time Complexity: O(1) Auxiliary Space: O(1) because constant variables are used Comment More infoAdvertise with us Next Article Java Program to Find Area of Rectangle Using Method Overloading ankita_saini Follow Improve Article Tags : Java Java Programs Practice Tags : Java Similar Reads Java Program to Find Area of Square Using Method Overloading A square is a simple flat shape in a plane, defined by four points at the four corners. It has four sides with equal length and four corners with right angles. Method Overloading: Method overloading allows different methods to have the same name, but different signatures where the signature can diff 3 min read Java Program to Find Area of circle Using Method Overloading A circle is a simple shape consisting of all the points in the plane that are equidistant from a point known as the center of the circle. In this article, we will learn how to find the area of the circle using the method overloading. Terminology: Method Overloading: Method overloading allows differe 3 min read Java Program to Find the Perimeter of a Rectangle A Rectangle is a quadrilateral with four right angles (90°). In a rectangle, the opposite sides are equal. A rectangle with all four sides equal is called a Square. A rectangle can also be called as right angled parallelogram. Rectangle In the above rectangle, the sides A and C are equal and B and D 2 min read Java Program to Find out the Area and Perimeter of Rectangle using Class Concept The perimeter is the length of the outline of a shape. To find the perimeter of a rectangle or square you have to add the lengths of all four sides. x is in this case the length of the rectangle while y is the width of the rectangle. The area is the measurement of the surface of a shape. The main ta 3 min read Java Program to Find the Area of Parallelogram A parallelogram is a special type of quadrilateral that has equal and parallel opposite sides. The diagonals of a parallelogram bisect each other at 90 degrees. The area of a figure can be defined in geometry as the space occupied by a flat shape. A figure's area is the number of unit squares that c 3 min read Like