📄 bird.java
字号:
public interface Runner {
void run();
}
interface Flyer
{ void fly(); }
interface Sleeper{
void sleep();
}
interface Animal extends Runner,Flyer,Sleeper{
void breathe();
}
class Bird implements Animal{
public void run()
{ System.out.println("The Bird is running"); }
public void fly()
{ System.out.println("The Bird is flying"); }
public void sleep()
{ System.out.println("The Bird is sleeping"); }
public void breathe()
{ System.out.println("The Bird is breathing"); }
public void runner(){
Runner r = new Bird();
r.run();
}
public void flyer(){
Flyer f=new Bird();
f.fly();
}
public void sleeper(){
Sleeper s=new Bird();
s.sleep();
}
public void animal(){
Animal a=new Bird();
a.breathe();
}
public static void main(String[] args) {
Bird b=new Bird();
b.runner();
b.flyer();
b.sleeper();
b.animal();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -