title: Check if a thread is interrupted?
body: <p>I just want to get know about if this thread is interrupting or not if I'm doing it right?
  please give me hint if I'm wrong</p>
  
  <pre><code>public void run(){
    int i;
    while(!Thread.currentThread().isInterrupted()){
      for(i=1;i&lt;=100;i++){
  
        System.out.println("THREAD VALUE AFTER 1 SECOND IS: "+i);
  
        if(i==3){
          Thread.currentThread().interrupt();
          gotoInform();
          break;
        }
        try{
          Thread.currentThread().sleep(1000);////to sleep the Thread for 1 Second (1000ms)
        }
        catch(Exception e){            
          System.out.printf("Error"+e);            
        }
      }
    }
  </code></pre>