如题!求代码!求详细注释!
------解决方案--------------------
- Java code
package test;import java.util.HashMap;import java.util.Map;public class SingleTon { private Map<Object,Object> map; private static SingleTon singleTon; private SingleTon(){ map = new HashMap<Object,Object>(); } public static SingleTon getSingleTon(){ if(singleTon == null){ singleTon = new SingleTon(); } return singleTon; } public void put(Object key, Object value){ map.put(key, value); } public Object get(Object key){ return map.get(key); }}