public class Interrupt_Thread
{   public static void main(String args[])
    {   A a=new A();
        a.student.start();     //߳
        a.teacher.start();
    }
}
class A implements Runnable
{   Thread student,teacher;
A()
    {  teacher=new Thread(this);        //̶߳
       student=new Thread(this); 
       teacher.setName("");      //̶߳
       student.setName("");
    } 
    public void run()      
    {  if(Thread.currentThread()==student)       //жϵǰڻ߳
       { try{  System.out.println(student.getName()+"˯");
              Thread.sleep(1000*60*60);       //1Сʱ
            }
            catch(InterruptedException e)
            { System.out.println(student.getName()+"ʦ");
            }
         System.out.println(student.getName()+"ʼ");
       }
      else if(Thread.currentThread()==teacher)
       {
         for(int i=1;i<=3;i++)
          { System.out.println("Ͽ!");
            try{ Thread.sleep(500);
               }
            catch(InterruptedException e){} 
          }
         student.interrupt();                     //student
       }
   }
}
