public class Soldier {
private String name;
private boolean dead;
private Weapon weapon;
public Soldier(){
p("执行Soldier的构造器");
}
public void showWeapon(){
p("执行showWeapon方法");
p(weapon.getWeaponName());
}
public String getName() {
p("执行getName方法");
return name;
}
public void setName(String name) {
p("执行setName方法");
this.name = name;
}
public boolean isDead() {
p("执行isDead方法");
return dead;
}
public void setDead(boolean dead) {
p("执行setDead方法");
this.dead = dead;
}
public void p(Object o){
System.out.println(o);
}
}
Soldier.java
最新推荐文章于 2022-10-27 17:32:08 发布