kodejava-lang-package/src/main/java/org/kodejava/example/lang/ThreadSleep.java
public void run() {
        System.out.println("Start thread [" + this.threadName + "]");
        try {
            while (true) {
                // Pause the thread for "sleep" milliseconds.
                Thread.sleep(this.sleep);
                System.out.println("[" + threadName + "]" +
                    Calendar.getInstance().getTime());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Finish thread [" + this.threadName + "]");
    }
// The run() method will be invoked when the thread is started.
The run() method will be invoked when the thread is started.
The run () method will be invoked when the thread is started .
public void run() {
        System.out.println("Start thread [" + this.threadName + "]");
        try {
            while (true) {
                Thread.sleep(this.sleep);
                System.out.println("[" + threadName + "]" +
                    Calendar.getInstance().getTime());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Finish thread [" + this.threadName + "]");
    }
public void run ( ) { System . out . println ( "Start thread [" + this . threadName + "]" ) ; try { while ( true ) { Thread . sleep ( this . sleep ) ; System . out . println ( "[" + threadName + "]" + Calendar . getInstance ( ) . getTime ( ) ) ; } } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } System . out . println ( "Finish thread [" + this . threadName + "]" ) ; }
The run() method will be invoked when the thread is started.
The run () method will be invoked when the thread is started .
// Pause the thread for "sleep" milliseconds.