赋值:
Map<String,Integer> items=new HashMap<String,Integer>()
{
{
put("I",1);
put("IV",4);
put("V",5);
put("IX",9);
put("X",10);
put("XL",40);
put("L",50);
put("XC",90);
put("C",100);
put("CD",400);
put("D",500);
put("DM",900);
put("M",1000);
}
};
取键(以下标为0的第一个元素为例):
items.keySet().toArray(new Integer[0])[0]);