請問各位,下面這個範例程式為什麼輸出只會有線程0執行??
ackage Thread02;
public class main {
public static void main(String[] args) {
Mythread02 T2=new Mythread02();
Thread t1=new Thread(T2);
Thread t2=new Thread(T2);
Thread t3=new Thread(T2);
t1.start();
t2.start();
t3.start();
}
下面是宣告的class
package Thread02;
public class Mythread02 implements Runnable {
private int number=100;
public void run() {
synchronized (this) {
try {
Thread.sleep(100);
//