考试
2021-02-25 12:20:28

(多选题)Given:Which two changes,

题目描述

Amove the line 12 print statement into the foo() method

Bchange line 7 to public synchronized void go() {

Cchange the variable declaration on line 2 to private volatile int x;

Dwrap the code inside the foo() method with a synchronized( this ) block

Ewrap the for loop code inside the go() method with a synchronized block synchronized(this){ //for loop code here }

答案解析

[db:答案解析]

A,D

加载中...
AI正在思考中,请稍候...