package cn.sxt.arrays;
/*
* 测试接口和实现
* @author chen_zan_yu
*
*/
public class test_interface {
public static void main(String[] args) {
Volant v=new Angel();
v.fly();
Honest h=new GoodMan();
h.helpOther();
}
}
/*
* 飞行接口
* @author chen_zan_yu
*
*
*/
interface Volant{
int FLY_HEIGHT=1000;
void fly();
}
//善良的接口
interface Honest{
void helpOther();
}
class Angel implements Volant,Honest{
@Override
public void helpOther() {
System.out.println("Angel.helpOther()");
}
@Override
public void fly() {
System.out.println("Ange.fly()");
}}
class GoodMan implements Honest{
@Override
public void helpOther() {
System.out.println("GoodMan.helpOther()");
}
class Birdman implements Volant{
@Override
public void fly() {
System.out.println("Birdman.fly()");
}
}
}