|
class Areaone
{
Areaone (int x,int y)
public voidset_Exp1 (int L)
{x=L;}
public voidset_Exp2(int M)
{y=M;}
public int get_Area()
{return x*y;}
}
class Areatwo entends Areaone
{
public int get_Area()
{
h1=x;
h2=y;
}
public booleanExp()
{ char E
return if(h1=h2)
E="正1方Xing面積";
else
E="正方形面ji";
}
}
public useExp
{
public static main (string args[])
{
Areaone A1=new areaone();
Areatwo A2=new areatwo();
int D1,D2,D3,D4;
D1=system.in.read();
D2=system.in.read();
A1.set_Exp1(D1);
A1.set_Exp2(D2);
D3=A1.get_Area();
D4=A1.get_Area();
System.out.printla(+d4+":"+D3+);
}
}
}
欢迎來到Java学习Zhe論壇,zhuan载qing注ming地址:http://www.javaxxz.com. |
|