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

📄 thread3.java

📁 java经典的源代码 我非常喜欢这个源代码 对于编程很有好处
💻 JAVA
字号:
class BytePrinter extends Thread {
   public BytePrinter(String name) {
      super(name);
   } 
   public void run() {
      for (int b = -128; b < 128; b++) {
         System.out.println(this.getName() + ": " + b);
      }
   }  
}

public class thread3 {
   public static void main(String args[]) {
      BytePrinter frank = new BytePrinter("Frank");
      BytePrinter mary = new BytePrinter("Mary");
      BytePrinter chris = new BytePrinter("Chris");
      frank.setPriority(Thread.MIN_PRIORITY);
      mary.setPriority(Thread.NORM_PRIORITY);
      chris.setPriority(Thread.MAX_PRIORITY);
      frank.start();
      mary.start();
      chris.start();
   }
}

⌨️ 快捷键说明

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