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

📄 testtwothreads1.java

📁 java2 primer plus一书源程序
💻 JAVA
字号:
/* * TestTwoThreads1.java * * Created on September 25, 2002, 12:08 PM */package ch18;/** * * @author  Stephen Potts */public class TestTwoThreads1 extends Thread{        /** Creates a new instance of TestTwoThreads1 */    public TestTwoThreads1()    {    }        public void run()    {        for ( int i=0; i<10; i++)        {            System.out.println("Hello from the new thread");        }        Thread t = Thread.currentThread();        System.out.println("The Thread name is " + t.getName());    }        public static void main(String[] args)    {        TestTwoThreads1 ttt1 = new TestTwoThreads1();        ttt1.start();                for (int i=1; i<10; i++)        {            System.out.println("Hello from the main thread");        }    }}

⌨️ 快捷键说明

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