Given: and the code fragment: 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 () {
This section is not available anymore. Please use the main Exam Page.1z0-809 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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, 9 months agosteefaand
Most Recent 10 months, 4 weeks agoiSnover
10 months, 4 weeks agoWilsonKKerll
2 years, 9 months agoWilsonKKerll
2 years, 9 months ago