日期:2014-05-20  浏览次数:20679 次

关于存储对象的问题
有这样的数据
  id name

------解决方案--------------------
什么问题?
------解决方案--------------------

Java code
  private static HashMap<Integer,A> map=new HashMap<Integer,A>();
  pubilc static void putToMap(int id,String name){
       A temp=null;
       if(map.get(id)!==null){
             temp=map.get(id);
             temp.name.add(name);
                
        }else{
           temp=new A(id,name);
        }
        map.put(id,temp);
  }