simplethread2main.java

来自「java 完全探索的随书源码」· Java 代码 · 共 22 行

JAVA
22
字号
public class SimpleThread2Main{  public static void main(String[] args)  {    // Create an instance of our new class that implements the    // Runnable interface    SimpleThread2 simpleThread = new SimpleThread2( "SimpleThread2" );    SimpleThread2 simpleThread1 = new SimpleThread2( "SimpleThread1" );    // Create a new instance of a thread using our Runnable class    // as the target and tell it to use "SimpleThread2" as the name    Thread newThread = new Thread( simpleThread, "SimpleThread2" );    Thread newThread1 = new Thread( simpleThread1, "SimpleThread1" );    // Start the thread    newThread.start();    newThread1.start();  }}

⌨️ 快捷键说明

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