1.Thread类的join方法表示:当前线程执行结束再执行其它线程!在Thread类中有三个重载的方法分别是: public final synchronized void join(long millis) throws InterruptedException { long base = System.currentTimeMillis(); long now = 0; if (millis < 0) { throw new IllegalArgumentException("tim…
使用join()方法 对各种数据类型中元的素进行合并拼接 "连接符".join(列表或元组或字符串或字典) 返回的是一个使用连接符进行拼接的字符串 如果对象是列表,元组,就是以一个下标元素为单位进行拼接 如果对象是字符串,就是一个单词元素为单位进行拼接 如果对象是字典,就是以一个键为单位进行拼接 列表 In [4]: a = ["123", "123"] In [5]: b = "".join(a) In [6]: b Out…
join t.start() t.join() Wait until the thread terminates. This blocks the calling thread until the thread whose join() method called terminates -- either normally or through an unhandled or until the optional timeout occurs. 将子线程join之后,主线程会等待这些join的子…