The threads t1 and t2 execute asynchronously and possibly prints ABCA or AACB. You have been asked to modify the code to make the threads execute synchronously and prints ABC. Which modification meets the requirement?
A.
start the threads t1 and t2 within a synchronized block.
B.
Replace line n1 with: private synchronized int count = 0;
C.
Replace line n2 with: public synchronized void run () {
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
JME_CHG
Highly Voted 3 years, 4 months agosteefaand
Most Recent 5 months, 4 weeks agoiSnover
5 months, 4 weeks agoWilsonKKerll
2 years, 4 months agoWilsonKKerll
2 years, 4 months ago