?? wind.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 + -