title: cannot find symbol error for the Thread.sleep function
body: <pre><code> import java.util.*;
  
  public class myProcess extends Thread
  {
  
  private Random R = new Random();
  private int id;
  
  public myProcess(int i){
      id = i;
  }
  
  private void delay(int value){
      try{
          sleep(R.nextInt(value));
      }
      catch(InterruptedException e){
          System.out.println("Exception caught");
      }
  }
  
  public void run(){
      // some code   
  }
  
  public static void main(String [] args){
  
     // some code
  }
  
  
   }
  </code></pre>
  
  <p>When I compile the above code, the following error shows up</p>
  
  <pre><code>Error: cannot find symbol
    symbol:   method sleep(int)
    location: class myProcess
  </code></pre>
  
  <p>I can't seem to find the solution.I tried to change the sleep function to Thread.sleep, but it just changes the error location to class Thread. What is wrong with it?</p>