There should be two threads 'ODD' thread and 'EVEN' thread- 'ODD' thread will first print 1 and then will allow the 'EVEN' thread to print 2. 'ODD' thread will then print 3 and the 'EVEN' thread will print 4 and so on -
Code
Output
Code
Output
Helpful!!!
ReplyDelete