//LinkedHashMap先入先出
public class Test {public static void main(String[] args) {Mapmap = new HashMap ();map.put("aaa", "111");map.put("bbb", "222");map.put("ccc", "333");for(Entry e :map.entrySet()){System.out.println("key:"+e.getKey()+",value:"+e.getValue());}} public static void main_1(String[] args) { LinkedHashMap map = new LinkedHashMap (); map.put("1", "one"); map.put("2", "tow"); map.put("3", "three"); for(Entry e: map.entrySet()){ System.out.println(e.getKey()+":"+e.getValue()); } } }