Interface implementation hiding method
问题 I need advice on interfaces. I have a class called Unit which can attack other units. The attack can be air or ground. I need single method to achieve attacking called attack() . Some units can only attack ground units, some air units or both. This is what I've come up so far: public interface Attack() { public void attack(SCObject object); } public interface GroundAttack() extends Attack { public void groundAttack(SCObject object); } public interface AirAttack() extends Attack { public void