Sleeping for a While : Sleeping « Thread « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Thread » Sleeping 
7.7.2.Sleeping for a While
The Thread that calls the sleep method is put to sleep for a number of milliseconds 
at least equal to the input parameter. 


1. Thread.sleep(long millisecs)
2. Thread.sleep(long millisecs, int nanosecs )


public class MainClass {
  public static void main(String[] argv) {
    try {
      Thread.sleep(500);
    catch (InterruptedException e) {
    }

  }
}
7.7.Sleeping
7.7.1.Thread.sleep()
7.7.2.Sleeping for a While
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.