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

📄 visitors.java

📁 Java经典例程 从外国一大学计算机教授出版物下载的代码 经典
💻 JAVA
字号:
class Visitors extends Thread {

  Visitors (Museum m, int w) {
    museum = m;
    groupSize = w;
  }

  public void run () {

    // The group walks around on its own for 50 time units.
    // You may need to alter this figure to suit your computer.
    // They then replace all their Walkmen and leave.
    // The thread dies with them.
    try {sleep((int) (Math.random()*1000)+1);}
          catch(InterruptedException e) {}
    museum.replace(groupSize);
  }

  Museum museum;
  int groupSize;
}

⌨️ 快捷键说明

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