java thread 如何控制多线程最后打印一句话

package com.ultimate.thread;


public class TestThreadJoin extends Thread{
	//public class TestThreadJoin implements Runnable{
	  private static Integer threadCount =5;//初始化线程数
	  @Override
		public void run() {
		  System.out.println("run this:"+Thread.currentThread().getName());
	  }
	  public static void main(String[] args) throws InterruptedException {
		  ThreadGroup group = new ThreadGroup("gmdGroup");
		  Thread[] threads=new Thread[threadCount];
		  TestThreadJoin t = new TestThreadJoin();
		  threads=new Thread[threadCount];
	        for(int i=0; i

 

你可能感兴趣的:(java)