/Java_21_Thread_Tester_1

A programm showing the invoke method of class thread Sleep(), it provides random sleep times for different threads.

Primary LanguageJava

#Thread_Tester_1

1- Starting by executing OrintThreads

2- Each object of this class picks a random sleep interval. when a PrintThread executes, it prints its name, sleeps, prints its name again, terminates.

3- Sleep between 0 and 5 seconds

4- display name and sleepTime

5- put thread to sleep for a random interval

6- if thread interrupted during sleep , catch exception and display error message

Note: System.err.println() is faster than System.out.println()