标签: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<Thread> list = new ArrayList<Thread>(); Runnable myRunnable = new MyRunnable(); for (int i = 0; i < 10000; i++) { Thread thread = new MyThread(myRunnable); thread.start(); list.add(thread); } for(Thread o: list) { try { o.join(); }catch (Exception E){ E.printStackTrace(); } } System.out.println("main finished ..."); } }
标签:https over read void ack mat csharp lis test
原文地址:https://www.cnblogs.com/SunshineKimi/p/11087524.html