日期:2014-05-20 浏览次数:20852 次
Map<String,String> map = new HashMap<String,String>();
String[] nodes = new String[10];
for (int i = 0; i < nodes.length; i++) {
nodes[i] = new String();
}
map.put(nodes[0],nodes[1]);
map.put(nodes[0],nodes[2]);
map.put(nodes[0],nodes[3]);
Iterator iter = map.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
System.out.println("Key="+entry.getKey().getClass()+" Val="+entry.getClass());
}
Map<String,String[]> map = new HashMap<String,String[]>();
String[] nodes = new String[10];
for (int i = 0; i < nodes.length; i++) {
nodes[i] = new String();
}
map.put(nodes[0],new String[]{nodes[1],nodes[2],nodes[3]});