- public class TestThread1 {
- public static void main(String [] args){
- MyThread mt=new MyThread();
- Thread t = new Thread(mt);
- t.start();
-
- for(int i=0;i<=100;i++) {
- System.out.println("main: "+i);
- }
- }
-
- }
-
- class MyThread implements Runnable {
- public void run(){
- for(int i=0;i<=100;i++) {
- System.out.println("---------"+i);
- }
-
- }
-
- }
复制代码 我的问题是:怎么理解Thread t = new Thread(mt)这句话。怎么理解把mt传到Thread的构造方法中。 |