这个是我以前的一道面试题:
public class MyThread extends Thread {
@Override
public void run() {
try {
MyThread.sleep(1000);
System.out.println("thread ....正常运行");
} catch (InterruptedException e) {
e.printStackTrace();
}
super.run();
}
public static void main(String[] args) {
Thread rThread = new Thread(new MyThread());
rThread.start();
}
}
打印:thread ....正常运行
时间: 2024-10-13 07:52:46