日韩欧美亚洲 _ 欧美亚洲一区 _ 日本亚洲欧美 _ 亚洲精品欧美 国产白袜脚足J棉袜在线观看_亚洲熟妇av一区二区三区_久久天天躁狠狠躁夜_精品众筹模特私拍在线

多項(xiàng)選擇題

Given the following code, which statements concerning the objects referenced through the member variables i, j and k are true, given that any thread may call the methods a, b and c at any time? () 
class Counter {  int v = 0;  
synchronized void inc() { v++; }  
synchronized void dec() { v--; }  
}  
public class Q7ed5 {  
Counter i;  
Counter j;  
Counter k;  
public synchronized void a() {  
i.inc();  
System.out.println("a");  
i.dec();  }  
public synchronized void b() {  
i.inc(); 
j.inc(); 
k.inc();  
System.out.println("b"); 
i.dec(); 
j.dec();
k.dec();  }  
public void c() {  
k.inc();  
System.out.println("c");  
k.dec();  
}  
}  

A.i.v is guaranteed always to be 0 or 1.
B.j.v is guaranteed always to be 0 or 1.
C.k.v is guaranteed always to be 0 or 1
D.j.v will always be greater than or equal to k.v at any give time.
E.k.v will always be greater than or equal to j.v at any give time.

微信掃碼免費(fèi)搜題