今天头晕,瞎几把写,还没写好,留给2年后的我作纪念。。。
class Weapen{
int power=1111;
int speed=66;
}
class Tank extends Weapen{
private char dir;
public char dir(char dir){
this.dir=dir;
return '左';
}
void Attack(){
System.out.println("一号坦克,请立即向"+one.dir()+"方向运动,速度"+one.speed+",攻击火力"+one.power);
}
}
public class Tankwar{
public static void main(String[] args){
Tank one=new Tank();
one.Attack();
}
}



