| 查看: 468 | 回复: 2 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
[求助]
这个输出信息中的5和main是什么意思
|
||
|
今天学习多线程基础,代码如下: class NewThread extends Thread { NewThread () { super("Demo Thread" ;System.out.println("Child thread: " + this) ; start(); } public void run() { try { for(int i=3; i>0; i--) { System.out.println("Child thread: " + i) ; Thread.sleep(50); } } catch(InterruptedException e) { System.out.println("Child interrupted." ;} System.out.println("Exiting child thread." ;} } public class ExtendThread { public static void main(String[] args) { new NewThread(); try { for(int i=3; i>0; i--) { System.out.println("Main Thread: " + i) ; Thread.sleep(100); } } catch(InterruptedException e) { System.out.println("Main thread interrupted." ;} System.out.println("Exiting main thread." ;} } 得到的输出结果为: Child thread: Thread[Demo Thread,5,main] Main Thread: 3 Child thread: 3 Child thread: 2 Main Thread: 2 Child thread: 1 Exiting child thread. Main Thread: 1 Exiting main thread. 请问,第一行的输出中[Demo Thread,5,main]里的 5 和 main 是什么意思? ![]() ![]() |
» 猜你喜欢
生物学308分求调剂(一志愿华东师大)
已经有3人回复
求调剂:一志愿:南京大学 专业:0705 总分320 ,本科985,四六级已过
已经有3人回复
环境工程 085701,267求调剂
已经有14人回复
308求调剂
已经有12人回复
求调剂:085600材料与化工,考材科基,总分319
已经有21人回复
311求调剂
已经有8人回复
294分080500材料科学与工程求调剂
已经有13人回复
288求调剂 一志愿哈工大 材料与化工
已经有19人回复
288资源与环境专硕求调剂,不限专业,有学上就行
已经有23人回复
一志愿085600中科院宁波所276分求调剂
已经有17人回复
3楼2016-05-23 22:17:34
sj1314
兑换贵宾
![]()
![]()
![]()
![]()
- 应助: 1 (幼儿园)
- 金币: 1115.7
- 散金: 120
- 红花: 26
- 帖子: 1151
- 在线: 213.3小时
- 虫号: 2673083
- 注册: 2013-09-23
- 性别: GG
- 专业: 生物医用高分子材料
2楼2016-05-23 09:28:23














;
回复此楼