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

📄 wind.java

📁 java的容器应用
💻 JAVA
字号:
//: Wind.java
// Inheritance & upcasting
import java.util.*;

class Instrument {
	protected void play() { System.out.println("Instrument playing"); }
	static void tune(Instrument i) {
		i.play();
	}
}

// Wind object are instruments
// because then have the same interface:
class Wind extends Instrument {
	protected void play() { System.out.println("Wind playing"); }
	public static void main(String[] args) {
		Wind flute = new Wind();
		Instrument.tune(flute);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -