Files
ICS23/src/RectangleArea.java
T

21 lines
557 B
Java
Raw Normal View History

2026-10-29 13:33:45 -04:00
import java.util.Scanner;
public class RectangleArea {
public RectangleArea() {}
public void display() {
Scanner scanner = new Scanner(System.in);
System.out.print("Length of the rectangle:");
int length = scanner.nextInt();
System.out.print("Width of the rectangle:");
int width = scanner.nextInt();
System.out.printf("The area of the rectangle is: %d", length*width);
}
public static void main(String[] args) {
RectangleArea r = new RectangleArea();
r.display();
}
}