Showing posts with label Program in JAVA for rectangle area. Show all posts
Showing posts with label Program in JAVA for rectangle area. Show all posts

Area and Perimeter of Rectangle,Java Rectangle Example,Calculating,program to find area and rectangle,

class Rectangle
     {

       int length, width;

       Rectangle(int x, int y)
               {
                length = x;
                width = y;
               }

           int rectArea()
            {
               return (length * width);
            }
     }

class RectangleArea
     {
        public static void main(String args[])
            {


               Rectangle rect1 = new Rectangle(15,10);
               int area1 = rect1.rectArea();
               System.out.println("Rectangle = " + area1);
             }
     }