选择题
- D
- C
- B
- C
- A
编程题
//创建接口
public interface IFly{
void fly();
}
public class Plane implements IFly{
public void fly(){
System.out.println("飞机在天上飞");
}
}
public class Bird implements IFly{
public void fly(){
System.out.println("小鸟在天空翱翔");
}
}
public class Balloon implements IFly{
public void fly(){
System.out.println("气球飞上天空");
}
}
public clas Test{
public static void main(String[] args) {
IFly plane=new Plane();
plane.fly();
IFly bird=new Bird();
bird.fly();
IFly balloon=new Balloon();
balloon.fly();
}
}