/** * Created by xfyou on 2016/11/3. * 多介面之間的繼承 */ public class HorrorShow { static void u(Monster b) { b.menace(); } static void v(DangerousMonster d) { d.menace(); d.destroy(); } public static void main(String[] args) { DragonZilla dz = new DragonZilla(); u(dz); v(dz); } } interface Monster { void menace(); } interface DangerousMonster extends Monster { void destroy(); } interface Lethal { void kill(); } class DragonZilla implements DangerousMonster { @Override public void menace() { } @Override public void destroy() { } } interface Vampire extends DangerousMonster, Lethal { void drinkBlood(); }