HashMap<IntegerString> map=HashMap<IntegerString>()map.put()map.put()map.put()Iterator iterator=map.keySet().iterator()(iterator.hasNext()){ Integer key=(Integer)iterator.next()System..println(key)String value=map.get(key)System..println(value)} Set<Map.Entry<IntegerString>> entrys=map.entrySet()Iterator it =entrys.iterator()(it.hasNext()){ Map.Entry entry=(Map.Entry) it.next()Object key1=entry.getKey()Object value1=entry.getValue()System..print(key1++value1+)}
时间: 2024-10-13 16:45:55