大家再告我一下,这个执行的是哪个run方法,具体说一下是为什么,老师讲的,我给忘了,谢谢大家!
- Thread thread1 = new Thread(new Runnable() {
- @Override
- public void run() {
- // TODO Auto-generated method stub
- System.out.println("Runnable"
- + Thread.currentThread().getName());
- }
- }) {
- @Override
- public void run() {
- // TODO Auto-generated method stub
- System.out.println("Thread" + Thread.currentThread().getName());
- }
- };
- thread1.start();
复制代码 |
|