本帖最后由 彭小康 于 2012-12-12 16:46 编辑
public class Extion {
public static void main(String args[])
{
Xiangjia Qs=new Xiangjia();
System.out.println(Qs.a); }
}
class Chengji
{
int zongFen;
Chengji(int a,int b)
{
zongFen=a+b;
}
protected float f(float x,float y)
{
return x*y;
}
}
class Xiangjia extends Chengji
{
static int yuWen=30;
static int shuXue=40;
int a;
Xiangjia()
{
a=(int) this.f(yuWen, shuXue);
super(yuWen,shuXue);
}
public float f(float x,float y)
{
return x+y;
}
} |