实现Runnable接口的类的对象直接调用run
与将对象传入Thread调用run有什么区别
1.
DemoRunnable dr = new DemoRunnable();
new Thread(dr).run();
2.
new DemoRunnable().run();
实现Runnable接口的类的对象直接调用run
与将对象传入Thread调用run有什么区别
1.
DemoRunnable dr = new DemoRunnable();
new Thread(dr).run();
2.
new DemoRunnable().run();