?????????????????

????a)???Thread???????????????????????????????????????????????????????????????Thread???е????????????????????????????????????????????????????????????????Java??е????????????????????

????b)???runnable????????????????????????????runnable???????????????????????Thread???????????????????????????????????????????????????????????????????????runnable????????????????????????

???????????????à???runnable?????????????thread????

????Thread_thread????????Thread?????

????Thread_runnable??????????runnable???????????run?????й???????

for(int i=0;i<20;i++){
if(ticket>0){
System.out.println(ticket);
ticket--;
}
}
thread_thread th1=new thread_thread();
thread_thread th2=new thread_thread();
thread_thread th3=new thread_thread();
th1.start();
th2.start();
th3.start();

??????????????321321321

??????????????????????????????????????????????

?????????runnable??????????????????thread????

thread_runnable ru=new thread_runnable();
Thread th1=new Thread(ru);
Thread th2=new Thread(ru);
Thread th3=new Thread(ru);
th1.start();
th2.start();
th3.start();

??????????32133

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????runnable?????????????????????????????Thread???á?