}
catch(InterruptedException e) {
// this part is executed when an exception (in this example InterruptedException) occurs
- System.out.println("InterruptedException: " + e);
+ System.err.println("InterruptedException: " + e);
}
String threadName = Thread.currentThread().getName();
System.out.println(threadName + " has slept for " + sleep_time + " ms for the " + (j + 1) + " times");