题库 软件开发 题目列表 以下代码运行时输出结果是什么 public class MyThre...
问答题
以下代码运行时输出结果是什么
public class MyThread extends Thread {
    public MyThread(){
        System.out.println(Thread.currentThread().getName());
}
@Override
public void run(){
    System.out.println(Thread.currentThread().getName());
    }
}
public class MainThread {
    public static void main(String[] args) {
        Thread.currentThread().setName("mainThread");
        MyThread myThread = new MyThread();
        myThread.setName("myThread");
        myThread.start();
    }
}
题目信息
校招真题
-
正确率
0
评论
22
点击