In the previous example the Shared class provides synchronized method for threads. Threads do nothing so if share class removes the synchronized then thread object will not be able to access the print method synchronously. There is second mechanism by which the thread can provided the synchronization to the any object or block. class MyThread1 extends Thread { Shared s; MyThread1(Shared s) { this .s = s; } public void run() { synchronized (s) { ...
Future driven solutions.