假设Server线程里有一静态成员client_map线程B使用getClient_map()获得静态成员后修改,Server中的client_map是否会被修改?
public class Server extends Thread{
private static HashMap client_map; public Server() {
client_map = new HashMap<String, Sender>();
} public static HashMap getClient_map() {
return client_map;
}
}
public class Server extends Thread{
private static HashMap client_map; public Server() {
client_map = new HashMap<String, Sender>();
} public static HashMap getClient_map() {
return client_map;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货