???????????
????@Override
????public void run(){
????for(int i = 0; i < 100; i++){
????System.out.println(this.getname()+":"+i);
????try{
????Thread.sleep(1000);
????}catch(InterruptedException e){
????System.out.println("????????");
????return;  //??????????????????????
????}
????}
????}
????????????Java????????????
????//???????????FlagThread?ж??????????????????ж?
????public void FlagThread extends Thread{
????//?????ж???
????private boolean isInterrupted = false;
????//?ж???????
????public void stopCurrentThread(){
????this.isInterrupted = true; //?ж???
????super.interrupt(); //???????ж????????
????}
????@Override
????public void run(){
????while(!isInterrupted){
????try{
????for(int i = 0; i < 100; i++){
????System.out.println(this.getname()+":"+i);
????Thread.sleep(1000);
????}
????}catch(InterruptedException e){
????//?ж???????????????????????
????}
????}
????System.out.println("????????");
????}
????}
??????????
????????????ж????????????????е???sleep(??????
????????IO??д???????
?????????????????????ж?IO????????????????????????????????? IO ??д????????????н??У??????????????????ж?????????????????????????????????????????????е????????????