循环取出来。。  int---->string  只要加个引号就OK了  例如:001+“”

解决方案 »

  1.   

    HashMap是键值存储的 ,根据键取得值
      

  2.   

    LZ。001 002 003 循环map.keySet()StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    pw.printf("%3d",1);
    Sysout.out.println(sw.toString());
      

  3.   

    import java.util.*;
    public class test { public static void main(String[] args){
    String str="";
    HashMap map=new HashMap();
    map.put("one","001" );
    map.put("two", "002");
    map.put("three", "003");
    Collection collect=map.values();//将map中的values取出来,并实现一个Collection接口
    Iterator it=collect.iterator();//再用Collection接口的迭代器
    while(it.hasNext()){
    str+=it.next().toString()+",";//通过迭代器遍历values
    }
    str=str.substring(0,str.length()-1);//去掉最后一个逗号
    System.out.println(str);//001,002,003
    }}
    是这样吧?输出是"001,002,003"
      

  4.   

    可以获取到值的inteor来迭代取出然后拼字符串