📄 chess.java
字号:
//: c06:Chess.java
// From 'Thinking in Java, 2nd ed.' by Bruce Eckel
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
// Inheritance, constructors and arguments.
class Game {
Game(int i) {
System.out.println("Game constructor\n" + "i in Game: "+i);
}
}
class BoardGame extends Game {
BoardGame(int i) {
super(i); //Must do it first
System.out.println("BoardGame constructor\n" + "i in BoardGame: "+i);
}
}
public class Chess extends BoardGame {
Chess() {
super(11);//Must do it first
System.out.println("Chess constructor: "+11);
}
public static void main(String[] args) {
Chess x = new Chess();
}
} ///:~
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -