最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

若只有My Thread怎么回事?錯(cuò)在哪了??

package seecen20160820例題;


public class Actor extends Thread{

? ? public void run(){

? ? System.out.println(Thread.currentThread(). getName()+"是一個(gè)演員!");

? ? int count =0;

? ? boolean keepRunning=true;

? ? while(keepRunning){

? ? System.out.println(Thread.currentThread().getName()+"登臺(tái)演出:"+( ++count) );

? ? if(count ==100){

? ? keepRunning =false;

? ? }

? ? if(count%10==0){

? ? try{

? ? Thread.sleep(1000);

? ? }catch(InterruptedException e){

? ? e.printStackTrace();

? ? }

? ? }

? ? }

? ? System.out.println(Thread.currentThread().getName()+"演出結(jié)束了!");

? ?

? ? }

? ? public static void main(String[] args) {

Thread actor =new Actor();

actor.setName("Mr.Thread");

actor.start();

?

Thread actressThread =new Thread(new Actress(),"Ms.Runnable");

actressThread.start();

? ?

} ?

}

class Actress implements Runnable{


@Override

public void run() {

}

}






正在回答

1 回答

你只設(shè)置了一個(gè)線(xiàn)程,只有My Thread,所以只會(huì)顯示My Thread。你的問(wèn)題不是很清晰,你的意思是想要多個(gè)線(xiàn)程?



0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

若只有My Thread怎么回事?錯(cuò)在哪了??

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

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

公眾號(hào)

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