This post is about how we can find out the Area of Rectangle in java. Area of Rectangle in java follows the basic syntax of mathematics to multiply two numbers. You have to keep in your mind that, Measurement of the Length is always greater than the measurement Breadth. Now Let's see how we can calculate the Area of Rectangle in java.
Objective:
Write a java program to calculate the area of the Rectangle.
Sample Input
Code
Output
Area of Rectangle: 56
2. Using Scanner Class
Here we are calculating the area of the rectangle in Java using Scanner Class. Scanner class basically use for taking the input from the users. By using the scanner class we can enter the values according to our choice.
Code
Output
Enter the Length Measurement
6
Enter the Breadth Measurement
5
Product of the Two Numbers is: 30
0 Comments