【发布时间】:2012-07-16 13:13:41
【问题描述】:
如何在 java.. 中使用 for 循环(或动态)创建多个地图(集合)?
List<Integer> temp = new ArrayList<Integer>();
for(int i=1; i<=10; i++)
{
Map<Integer, Map> temp.get(i) = new HashMap<Integer, Map>();
}
考虑 temp 的值为“一”、“二”...“十”
请帮忙..
【问题讨论】:
-
这是什么语言?也许是 Java?
-
temp不能有值"one","two"... "ten",因为它是List<Integer>。你的意思是1, 2, ..., 10? -
-1 用于在不学习语言的情况下提出问题。
-
什么类型的键和值的映射?你能详细说明一下吗?
标签: java collections