线程
public class RunnableTicket {public static void main(String args[]){
MyThread m1 =new MyThread();
MyThread m2 =new MyThread();
MyThread m3 =new MyThread();
new Thread(m1).start();
new Thread(m2).start();
new Thread(m3).start();
}
}
与public class RunnableTicket {
public static void main(String args[]){
MyThread m =new MyThread();
new Thread(m).start();
new Thread(m).start();
new Thread(m).start();
}
}
两种线程实现为什么第一种资源不共享,而第二种资源共享?谁能给我解释一下吗?非常感谢