SOURCE CODE:
class Area
{
int l,b;
Area(int x,int y)
{
l=x;
b= y;
}
int Result()
{
return l*b;
}
}
class Rectangle
{
public static void main(String args[])
{
Area A=new Area(10,5);
System.out.println("The Area of the Rectangle is : \t"+ A.Result());
}
}
OUTPUT :
The Area of the Rectangle is : 50
EmoticonEmoticon