我想迭代条目的值来获取条目的键和值,但不知道如何迭代条目。请指导我。
Iterator<Entry<String, Vector<PromoteTable>>> hmIterate = linkedHashmp.entrySet().iterator();
while(hmIterate.hasNext())
{
Entry<String, Vector<PromoteTable>> entry = hmIterate.next();
Object[] result = new Object[noOfRecords];
}
答案 0 :(得分:0)
您可以使用以下代码:
for (Map.Entry<String, Vector<PromoteTable>> entry : linkedHashmp.entrySet()) {
String key = entry.getKey();
Vector<PromoteTable> value = entry.getValue();
Object[] result = new Object[noOfRecords];
}