}
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);
}
}
System.out.println("Threads execution finished");
}
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");
wait();
}
catch (InterruptedException e) {
- System.out.println("InterruptedException: " + e);
+ System.err.println("InterruptedException: " + e);
}
}
nbObj++;
wait();
}
catch (InterruptedException e) {
- System.out.println("InterruptedException: " + e);
+ System.err.println("InterruptedException: " + e);
}
}
Object outObj = null;
Thread.sleep(ThreadLocalRandom.current().nextInt(1001));
}
catch (InterruptedException e) {
- System.out.println("InterruptedException: " + e);
+ System.err.println("InterruptedException: " + e);
}
}
}
Thread.sleep(ThreadLocalRandom.current().nextInt(101));
}
catch (InterruptedException e) {
- System.out.println("InterruptedException: " + e);
+ System.err.println("InterruptedException: " + e);
}
}
}
sock = new Socket(adresseIPServeur, portServeur);
}
catch (IOException e) {
- System.out.println("IOException: " + e);
+ System.err.println("IOException: " + e);
}
InputStream IStream = null;
try {
IStream = sock.getInputStream();
}
catch (IOException e) {
- System.out.println("IOException: " + e);
+ System.err.println("IOException: " + e);
}
InputStreamReader IMesg = new InputStreamReader(IStream);
lecture = new BufferedReader(IMesg);
OStream = sock.getOutputStream();
}
catch (IOException e) {
- System.out.println("IOException: " + e);
+ System.err.println("IOException: " + e);
}
ecriture = new PrintWriter(OStream);
}
line = lecture.readLine();
}
catch (IOException e) {
- System.out.println("IOException: " + e);
+ System.err.println("IOException: " + e);
}
return line;
}
lecture.close();
}
catch (IOException e) {
- System.out.println("IOException: " + e);
+ System.err.println("IOException: " + e);
}
}