JAVA Program to Find Area of Rectangle

JAVA Program to Find Area of Rectangle:


class rect
{
 int len,wid;
 int area;
 rect(int l,int w)
 {
  len=l;
  wid=w;
 }

 void area()
 {
   System.out.println("Area of Rectangle is:"+(len*wid));
 }

 public static void main(String args[])
 {
  rect r=new rect(20,10);
  r.area();
 }
}

OUTPUT:

Area of Rectangle is:200

Leave a Reply

Your email address will not be published. Required fields are marked *

ten + 8 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.