Computer Science, asked by gunjotsingh0909, 1 month ago

wap the to print a series by using Java .
don't scam . otherwise I will do a report.​

Attachments:

Answers

Answered by saransrini03
0

class FindRectangleArea

{

   public static void main(String arg[])

   {

       Rectangle rect = new Rectangle(10, 5);

       

       System.out.println("Length = " + rect.length);

       System.out.println("Breadth = " + rect.breadth);

       System.out.println("Area = " + rect.getArea());

       System.out.println("Perimeter = " + rect.getPerimeter());

   

   }

}

class Rectangle

{

   double length;

   double breadth;

   Rectangle(double length, double breadth)

   {

       this.length = length;

       this.breadth = breadth;

   }

   double getArea()

   {

       return length * breadth;

   }

   double getPerimeter()

   {

       return 2 * (length + breadth);

   }

Similar questions