⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bird.java

📁 学习算法写的经典算法程序
💻 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 + -