java 多线程

2020-12-13 03:46

阅读:480

标签:https   over   read   void   ack   mat   csharp   lis   test   

import  java.util.*;
        import java.text.*;

class MyRunnable  implements Runnable {
    @Override
    public void run() {

        System.out.println("in MyRunnable run");
    }
}

class MyThread extends Thread {

    public MyThread(Runnable runnable){
        super(runnable);
    }

    @Override
    public void run() {
        Date dNow = new Date( );
        SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
        String time=ft.format(dNow);
        System.out.println("in MyThread run");
        System.out.println(time);
    }
}
public class ThreadTest {
    //https://www.journaldev.com/1016/java-thread-example
    public static void main(String[] args) {
        List list = new ArrayList();
        Runnable myRunnable = new MyRunnable();

        for (int i = 0; i 

  

java 多线程

标签:https   over   read   void   ack   mat   csharp   lis   test   

原文地址:https://www.cnblogs.com/SunshineKimi/p/11087524.html


评论


亲,登录后才可以留言!