第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

求大神指教

求大神指教

qq電子時代 2016-04-19 14:18:20
package com.Thread;import sun.rmi.runtime.Log;public class Thread0202 extends Thread { public void run() { Thread0201 t1 = new Thread0201(); Thread0201 t2 = new Thread0201(); // 使用Runnable接口創(chuàng)建線程 Thread one = new Thread(new Thread0201(), "one"); Thread two = new Thread(new Thread0201(), "two"); one.start(); two.start(); // 為什么start一開始 下面的命令不會執(zhí)行 而且廝殺過程一直不會停止 try { Thread.sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } t1.i = false; t2.i = false; try { two.join(); } catch (InterruptedException e) { e.printStackTrace(); } } public static void main(String[] args) { new Thread0202().start(); }}
查看完整描述

1 回答

已采納
?
qq_青棗工作室_0

TA貢獻(xiàn)446條經(jīng)驗 獲得超754個贊

因為你start的線程沒有用到t1和t2啊。

//?使用Runnable接口創(chuàng)建線程
Thread?one?=?new?Thread(new?Thread0201(),?"one");????//?這里你new了一個Thread0201,應(yīng)該用t1
Thread?two?=?new?Thread(new?Thread0201(),?"two");??//?這里你new了一個Thread0201,應(yīng)該用t2


查看完整回答
1 反對 回復(fù) 2016-04-19
  • 1 回答
  • 0 關(guān)注
  • 1910 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號