/src/ThreadsSynchronization/SynchronizationTest.java
https://bitbucket.org/Marin_Abaluta/exercitiul_15 · Java · 24 lines · 16 code · 8 blank · 0 comment · 0 complexity · b071576cd6f2a8f9baa15e3a98f3919b MD5 · raw file
- package ThreadsSynchronization;
- public class SynchronizationTest {
- public static void main(String[] args) {
- Sender snd = new Sender();
- ThreadedSend t1 = new ThreadedSend(snd, "Hi Terry Williams");
- ThreadedSend t2 = new ThreadedSend(snd, "We hope you enjoy the stay at our hotel!");
- t1.start();
- t2.start();
- try {
- t1.join();
- t2.join();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }