企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
### 释放执行资格 ~~~ public static void main(String[] args)throws Exception{ Thread t1 = new Thread(new Runnable() { @Override public void run() { for (int i=0; i<30; i++){ try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("子线程 : "+ i); } } }); t1.start(); // 当前线程释放执行资格,等待t1执行完毕之后,才会继续执行 t1.join(); for (int i=0; i<10; i++){ System.out.println("主线程 : "+ i); } System.out.println("主线程执行结束"); } ~~~