SlideShare ist ein Scribd-Unternehmen logo
1 von 7
作業系統作業
-執行緒
D1024241042 莊英基
畫面1
1.Thread() – ThreadExample1
執行結果
 Constrctor沒有參數,Thread()產生的Thread,進入點為
run()。當run()結束時,這個執行緒也就結束了,和mian()結
束有相同效果。
 1.第4行,覆蓋執行緒的運行。
 2.第5行,印出這裡是執行緒的起點。
 3.第6行,無限循環印出訊息。
 4.第7行,印出User Created Thread。
 5.第11行,產生Thread物件。
 6.第12行,開始執行 t.run()。
 7.第13行,進入無限循環印出訊息。
 8.第14行,印出Main Thread。
 執行以上程式後,螢幕會持續印出User Created Thread 或
Main Thread。
解釋
畫面2
2.Thread(Runnable) – ThreadExample2
執行結果
 需要一個Runnable物件當參數,Thread(Runnable)產生的
Thread,進入點為Runnable物件裡的run()。當run()結束時,
這個執行緒也就結束了,與main()結束有相同的效果。
 1.第4行,執行Runnable的運行。
 2.第5行,印出這裡是執行緒的起點。
 3.第6行,無限循環印出訊息。
 4.第7行,印出User Created Thread。
 5.第11行,產生Thread物件。
 6.第12行,開始執行 Runnable.run()。
 7.第13行,進入無限循環印出訊息。
 8.第14行,印出Main Thread。
 執行以上程式後,螢幕會持續印出User Created Thread 或
Main Thread。
解釋

Weitere ähnliche Inhalte

Andere mochten auch

Rami-okasha-CV 2
Rami-okasha-CV 2Rami-okasha-CV 2
Rami-okasha-CV 2
Rami Okasha
 
Power_Point_Presentation_ISSC458_Intindolo
Power_Point_Presentation_ISSC458_IntindoloPower_Point_Presentation_ISSC458_Intindolo
Power_Point_Presentation_ISSC458_Intindolo
John Intindolo
 
Sanjay Gupta Profile(new)
Sanjay Gupta Profile(new)Sanjay Gupta Profile(new)
Sanjay Gupta Profile(new)
Sanjay Gupta
 
Questionnaire analysis 1
Questionnaire analysis 1Questionnaire analysis 1
Questionnaire analysis 1
sarahlouise12
 
Prashant Resume-22.11.15
Prashant Resume-22.11.15Prashant Resume-22.11.15
Prashant Resume-22.11.15
Prashant Asati
 

Andere mochten auch (14)

Asset Allocation
Asset AllocationAsset Allocation
Asset Allocation
 
Rami-okasha-CV 2
Rami-okasha-CV 2Rami-okasha-CV 2
Rami-okasha-CV 2
 
Power_Point_Presentation_ISSC458_Intindolo
Power_Point_Presentation_ISSC458_IntindoloPower_Point_Presentation_ISSC458_Intindolo
Power_Point_Presentation_ISSC458_Intindolo
 
Life Under the Big Tent-Making Festivals Work
Life Under the Big Tent-Making Festivals WorkLife Under the Big Tent-Making Festivals Work
Life Under the Big Tent-Making Festivals Work
 
Om0012 supply chain management
Om0012 supply chain managementOm0012 supply chain management
Om0012 supply chain management
 
WDM RESUME 2016
WDM RESUME 2016WDM RESUME 2016
WDM RESUME 2016
 
Tinh toan ket_cau_thep(_nguyen_van_yen)_
Tinh toan ket_cau_thep(_nguyen_van_yen)_Tinh toan ket_cau_thep(_nguyen_van_yen)_
Tinh toan ket_cau_thep(_nguyen_van_yen)_
 
Sanjay Gupta Profile(new)
Sanjay Gupta Profile(new)Sanjay Gupta Profile(new)
Sanjay Gupta Profile(new)
 
Memórias secundarias 2
Memórias secundarias 2Memórias secundarias 2
Memórias secundarias 2
 
Video editing tips - Colin J Smith
Video editing tips - Colin J SmithVideo editing tips - Colin J Smith
Video editing tips - Colin J Smith
 
Tarea nº 3 actividades ii
Tarea nº 3 actividades iiTarea nº 3 actividades ii
Tarea nº 3 actividades ii
 
Acms el-secretario-de-iglesia
Acms el-secretario-de-iglesiaAcms el-secretario-de-iglesia
Acms el-secretario-de-iglesia
 
Questionnaire analysis 1
Questionnaire analysis 1Questionnaire analysis 1
Questionnaire analysis 1
 
Prashant Resume-22.11.15
Prashant Resume-22.11.15Prashant Resume-22.11.15
Prashant Resume-22.11.15
 

Kürzlich hochgeladen

Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
daisycvs
 
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
cytotecshop6
 
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
zuhaibhaideri99
 
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
fionamali24
 
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVCHi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
schonejummy
 
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ramacollinz
 
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
ramacollinz
 
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
fionamali24
 
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
daisycvs
 
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
schonejummy
 
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
schonejummy
 
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
schonejummy
 

Kürzlich hochgeladen (14)

《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》
《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》
《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》《段永平(投資的本質)》
 
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
Abortion Pills for sale in Ajman (UAE) ((+27.7377;58;557) Abortion Pills / Cy...
 
cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。
cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。
cs代写服务如何收费?坚持高性价比的服务宗旨 ,满足更多留学生的CS作业代写需求,为大家提供最合理的代写价格。
 
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
ABORTION PILLS IN AL WAKRAH《@௵+971523788684௵》CYTOTEC TABLETS FOR SALE IN DOHA...
 
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
IN MUSCAT & OMAN 🏥[^(+968_76875161*))☎️)¥) LEGIT Cytotec Pills.
 
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
Abortion in AL AIN*%UAE^*[☎️+971523788684**]]@ @# Abortion pills for sale in ...
 
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVCHi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
Hi 00971552965071 ABORTION PILLS IN Marina Palm Jumeirah JVC
 
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
ABORTION PILLS IN BADPLAAS [(+27632505360 BUY CYTOTEC PILLS IN BADPLAAS/ABORT...
 
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
Secunda +27<~>0632505360 Abortion Pills Around Embalenhle Approved Safe 4 Ter...
 
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
Kuwait City₩Kit【+971523788684】彡 ௹#Abortion Pills For sale In Kuwait City.
 
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
Where to buy(^^+27737758557** Abortion Pills in Dubai/UAE/ Abudhabi/Fujairah ...
 
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
Al Doha +971552965071 Abortion Pills in Doha Qatar Al Wakrah misoprostol/cyto...
 
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
Bulawayo +27632505360 Abortion Pills in Bulawayo Harare Cytotec/Misoprostol i...
 
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
IN Port Alfred [[[[WhatsApp (((+27632505360))) *____**)) ABORTION PILLS FOR S...
 

作業系統作業莊英基