标签:ati sys span rac pre col [] end battle
abstract class TakeOffSystem { public abstract void fly(); public abstract void land(); } class BattlePlan extends TakeOffSystem{ public void fly(){ System.out.println("战斗机起飞了"); } public void land(){ System.out.println("战斗机降落了"); } } class HeliCopter extends TakeOffSystem{ public void fly(){ System.out.println("直升机起飞了"); } public void land(){ System.out.println("直升机降落了"); } } class GunDam extends TakeOffSystem{ public void fly(){ System.out.println("高达起飞了"); } public void land(){ System.out.println("高达降落了"); } } public class FlyTest{ public static void main(String[] args) { TakeOffSystem a = new BattlePlan(); TakeOffSystem b = new HeliCopter(); TakeOffSystem c = new GunDam(); a.fly(); a.land(); b.fly(); b.land(); c.fly(); c.land(); } }
标签:ati sys span rac pre col [] end battle
原文地址:http://www.cnblogs.com/finsky/p/7896060.html