class Area
{
public void A(int l)
{
System .out.println("area of square is="+(l*l));
}
public void A(int l,int b)
{
System.out.println("area of rectangle is="+(l*b));
}
}
class action extends Area
{
Area a;
public action()
{
a=new Area();
a.A(4);
a.A(4,5);
}
public static void main(String as[])
{
new action();
}
}
Output:
area of square is=16
area of rectangle is=20
0 Comments
Post a Comment