for(int i=0; i< n; i++) {
hashMap.put("Name",name.get(i));
hashMap.put("Website",website.get(i));
}
Run Code Online (Sandbox Code Playgroud)
我想迭代地向HashMap添加多个值我希望我的输出是这样的
我如何添加到hashmap,我没有得到预期的结果.
我猜你想要这个:
for(int i=0; i< n; i++) {
hashMap.put(name.get(i), website.get(i));
}
Run Code Online (Sandbox Code Playgroud)