class ThreadDemo2 {
public static void main(String[] args) {
MyRunnable mr = new MyRunnable();
Thread t = new Thread(mr);
t.start();
for (int i = 0; i < 1000; i++)
System.out.println("C");
}
}
class MyRunnable implements Runnable {
public void run() {
for (int i = 0; i < 1000; i++)
System.out.println("D");
}
}
关于下面语句,是怎么实现的?求详解!!!!
MyRunnable mr = new MyRunnable();
Thread t = new Thread(mr);
t.start();
|
|