| 查看: 553 | 回复: 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 是什么意思? ![]() ![]() |
» 猜你喜欢
为什么余额宝的年化利率越来越低?主要原因有哪些?
已经有4人回复
今天放榜吗?
已经有13人回复
filecode,4个jtjc了
已经有9人回复
今天基金会出结果吗?20260819
已经有8人回复
欢迎发来filecode的Mz6后的代码验证其规律
已经有115人回复
2027广东省杰青
已经有10人回复
朋友圈看到的
已经有8人回复
时间戳变了,能看出什么问题?
已经有14人回复
咱们一起用铁证分析2026国家社科基金中标与否
已经有30人回复
快农历七夕节了,轻松一下,男人悄悄话,女施主请不要进来。
已经有7人回复
sj1314
金虫 (著名写手)
- 应助: 1 (幼儿园)
- 金币: 1115.7
- 散金: 120
- 红花: 26
- 帖子: 1151
- 在线: 213.3小时
- 虫号: 2673083
- 注册: 2013-09-23
- 性别: GG
- 专业: 生物医用高分子材料
2楼2016-05-23 09:28:23
3楼2016-05-23 22:17:34










;
回复此楼