package com.xxx.utils.pack; public class JoinTest { public static void main(String[] args) { Thread thread = new Thread(new Runnable() { @Override public void run() { System.out.println("wait 1s for join "); } }); thread.start(); try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("main down"); } }