11 Replies Latest reply: Nov 7, 2006 11:07 AM by 807607 RSS

    sending threads to sleep

    807607
      writing w = new writing("     ");
           Thread t = new Thread(w);
          t.start();t.setName("1");
          t.sleep(100);
      this code here is creating an instance of writing which processes the threads then i go onto create the thread start it and set its name. when i try to send it to sleep though it wont compile.
      static void      sleep(long millis) is the type of the method i am calling

      it says it has an error unhandled exception type InteruptedException

      does anyone know how to get it to work?