首页 新闻 会员 周边

应该是什么结果呢?

0
悬赏园豆:10 [已解决问题] 解决于 2022-12-15 14:03

public class TestGetThread extends Thread {
TestGetThread(String s){
super(s);
}
public void run() {
System.out.println(this.getName());
}
public static void main(String args[]) {
System.out.println(Thread.currentThread().getName());
TestGetThread thread1 = new TestGetThread("线程1"):
TestGetThread thread2 = new TestGetThread("线程2");
thread1.start();
thread2.start();
}
}

程序运行的结果:
(1)_______
(2)______
(3)____________

peir的主页 peir | 初学一级 | 园豆:105
提问于:2022-12-11 15:14
< >
分享
最佳答案
0

main
线程1
线程2

收获园豆:10
bug厌恶者 | 菜鸟二级 |园豆:229 | 2022-12-12 17:24

谢谢!

peir | 园豆:105 (初学一级) | 2022-12-15 14:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册