4月12日,TestMyThread,每日20行。

来源:互联网 发布:linux系统api有哪些 编辑:程序博客网 时间:2024/05/17 18:25
class MyThread extends Thread {    public void run(){        while(true){            System.out.println(Thread.currentThread().getName() + " is running");        }    }}public class TestMyThread {    public static void main(String[] args) {        new MyThread().run();//new MyThread().start();        while(true){            System.out.println("main1 thread is running");        }    }}

这里写图片描述

0 0
原创粉丝点击