I am having problem dealing with synchronization java threads, applying wait and notify..
I want to figure out how could I implement these in a program where I can print out the answer alternately.. for example person1 will count numbers 1-5 as well as person2, the output should be like this.
person1 count 1
person2 count 1
person1 count 2
person2 count 2
person1 count 3
person2 count 3
person1 count 4
person2 count 4
person1 count 5
person2 count 5
Thanks guys.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…