title: Java -The method sleep(int) is undefined for the type Thread
body: <p>I'm getting an error: The method sleep(int) is undefined for the type Thread. I thought the sleep method is in the Thread class in Java.</p>
  
  <pre><code>import java.util.Random;
  
  public class Thread implements Runnable {
  
      String name;
      int time;
      Random r = new Random();
  
      public Thread(String s){
          name = s;
          time = r.nextInt(999);
      }
  
      public void run() {
          try{
              System.out.printf("%s is sleeping for %d\n", name, time);
              Thread.sleep(time);
              System.out.printf("%s is done", name);
          } catch(Exception e ) {
          }
      }
  }
  </code></pre>