Java接口之间的继承

/**
* 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();
}
上一篇:Codeforces 551D GukiZ and Binary Operations(矩阵快速幂)


下一篇:ChatterBot之linux下安装mongodb 02