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

📄 chess.java

📁 Java编程思想 第六课 全源码
💻 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 + -