展开全部
package hashmaptest;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class TestMap {
public static void main(String[] args) {
Map<HashMap<Integer, String>, String> map = new HashMap<HashMap<Integer, String>, String>();
HashMap<Integer, String> key = new HashMap<Integer, String>();
key.put(1, "a");
key.put(2, "b");
map.put(key, "A");
Iterator itr = map.entrySet().iterator();
while(itr.hasNext()){
System.out.println(itr.next().toString());
}
}
}
输出结果:
{1=a, 2=b}=A
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询