标签:imp out ase get hashmap logs javase tor import
package com.xiaoer.javaSEstudy; import java.util.HashMap; import java.util.Map; import org.junit.Test; public class TestHashMapIterator { @Test public void testEntrySet(){ Map<String, String> map = new HashMap<String, String>(); map.put("1", "王宁"); map.put("2", "王寒"); map.put("3", "王慧"); for(Map.Entry<String, String> entry:map.entrySet()){ System.out.println("key:"+entry.getKey()+",value:"+entry.getValue()); } } @Test public void testKeySet(){ Map<String, String> map = new HashMap<String, String>(); map.put("1", "王宁"); map.put("2", "王寒"); map.put("3", "王慧"); for(String key:map.keySet()){ System.out.println("key:"+key+",value:"+map.get(key)); } } }
标签:imp out ase get hashmap logs javase tor import
原文地址:http://www.cnblogs.com/sosolili/p/7345235.html