Input
Output
public class Oops { public static void main(String args[]){ // r1 is the object created for the class Rectangle Rectangle r1=new Rectangle(); r1.length=5; r1.breadth=6; System.out.println("Enter the length and breadth value: "+r1.length+" "+r1.breadth); r1.area = r1.length * r1.breadth; System.out.println("Area of the Rectangle: "+r1.area); } } class Rectangle { int length,breadth; float area; }