📄 ch9ex6.java
字号:
class Instrument{
public void play(){}
static void tune(Instrument i){
// ...
i.play();
}
}
class Wind extends Instrument{
//...
}
public class ch9ex6{
public static void main(String[]args){
Wind flute = new Wind();
Instrument.tune(flute); // Upcasting
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -