package testInertface;
public class TestInterface {
public static void main(String[] args){
Angle a=new Angle();
a.fly();
a.helpOthers();
}
}
/*飞行接口
* */
interface Volant{
int FLY_HEIGHT=100;//public static final int FLY_HEIGHT=100;
void fly();//public static void fly();
}
/*善良接口*/
interface Honest {
void helpOthers();
}
class Angle implements Volant,Honest{
@Override
public void fly() {
System.out.println("Angle fly");
}
@Override
public void helpOthers() {
System.out.println("Angle help others");
}
}
class birdMan implements Volant{
@Override
public void fly() {
System.out.println("birdMan fly");
}
}
java接口
最新推荐文章于 2024-10-27 15:49:02 发布