Java Programs

Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 1: Write a Java program to calculate the area of the rectangle.

import java.util.Scanner;

public class Rectangle
	public static void main(String[] args)
		//Declaring Variables	
		int length;
		int breadth;
		int Area;

		Scanner s =new Scanner(;

		System.out.println("Enter the length of the Rectangle");

		System.out.println("Enter the breadth of the Rectangle");


		System.out.println("Area: "+Area);		

If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.