map 取key value
package com.yunclean;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Map<Map<String,String>, Integer> m = new HashMap<Map<String,String>, Integer>();
Map<String,String> maps = new HashMap<String,String>();
maps.put("1", "2");
Map<String,String> mapss = new HashMap<String,String>();
mapss.put("2", "3");
Map<String,String> mapsss = new HashMap<String,String>();
mapsss.put("3", "4");
m.put(mapss, 20);
m.put(maps, 30);
m.put(mapsss, 40);
//System.out.println("aaaaaaa"+m.size());
System.out.println(m);
Set set=m.keySet();
System.out.println(set);
Iterator iter = set.iterator();
while (iter.hasNext()) {
HashMap<String,String> k=(HashMap<String,String>)iter.next();
Set sets=k.keySet();
Iterator iters = sets.iterator();
String a = (String)iters.next();
System.out.println("aaaaaaa"+a);
System.out.println("bbbbbbbb"+k.get(a));
/*while (iters.hasNext()) {
String ks = (String)iters.next();
System.out.println("----------"+ks);
System.out.println(k.get(ks));
}*/
System.out.println(k +" "+ m.get(k));
}
}
}