sleep(1000);
函数在哪个包里

解决方案 »

  1.   

    try {
      threadName.sleep(1000)
    } catch (Exception e) {}
      

  2.   

    public class Test
     { 
      public static void main(String args[])
       {
        System.out.println("hello");
        try{
         Thread.sleep(10000);
        }catch(InterruptedException e)
        {
        
        }
        
        System.out.println("world");
         }
      }
      

  3.   

    try {
          Thread.currentThread().sleep(ms);
        }
        catch (InterruptedException ex) {
        }