15 lines
407 B
Java
15 lines
407 B
Java
package exercises.ex_c;
|
|
|
|
public class TestingSleep {
|
|
public static void main(String[] args) throws InterruptedException {
|
|
Thread thread = new Thread(new SleepMessages());
|
|
thread.start();
|
|
|
|
System.out.println("Waiting 3 seconds");
|
|
Thread.sleep(3000);
|
|
System.out.println("Stopping thread");
|
|
thread.interrupt();
|
|
System.out.println("Stopped");
|
|
}
|
|
}
|