【发布时间】:2013-02-20 11:24:20
【问题描述】:
private static Map<Integer, String> map = null;
public static String getString(int parameter){
if(map == null){
map = new HashMap<Integer, String>();
//map gets filled here...
}
return map.get(parameter);
}
随着多线程的发展,该代码是否不安全?
【问题讨论】:
-
这是什么语言?爪哇?
标签: java multithreading static-methods