6 Replies Latest reply: Apr 24, 2007 2:48 PM by 807606 RSS

    Problems overriding interrupt() method in Thread

    807606
      I have a class that extends Thread and overrides interrupt() method but it does not seem to be using that. I have some print statements in my method but they never get printed.
      public class ProcessingThread extends Thread { 
      
         public void run () {
             // Processing code
         }
      
      public void interrupt() { 
           System.out.println("Interrupt() method");
      
           super.interrupt();
      }
      It won't print the statement in the interrupt() method. I tried to add synchronized as well,. Is it possible or maybe java does not allow this?