To determine the area of a rectangle in Java, simply multiply its length by its width.
int length = 5;
int width = 2;
int area = length * width;
System.out.println(“Area of rectangle: “ + area);