Hi,
I have query for
thread synchronization.
Suppose there are three threads and there is one method which takes number as input and prints number.
If threads passes same number, number should print one time and if different numbers provided as input then all different number should print.
For e.g.
If thread1 and thread2 passes 1 as input to method and thread 3 passes 2 as input then 1 should print once and 2 should print once.
If thread 1 passes 1, thread 2 passes 2 and thread 3 passes 3 then all number should get printed as all are different.
Please suggest me how I shall achieve this.
Regards,
Abhishek