// We are calculating area of a rectangle with Java programming . public class Main { public static void main(String[] args) { // main method is defining // Create integer variables int length = 4; int width = 6; int area;
// Calculate the area of a rectangle
area = length * widtth;
// Print variables
System.out.println("Length is: " + length); // Plus sign is adding the variables's value.
System.out.println("Width is: " + width); // Output should be Width is : (width value's).
System.out.println("Area of the rectangle is: " + area);
} }