首页 > 技术文章 > LinkedHashMap元素次序存取保持一致

zhujialei123 2018-05-14 20:23 原文

package com.day15.Map;

import java.util.LinkedHashMap;

public class LinkedHashMap_One {

  public static void main(String[] args) {
    LinkedHashMap<String, Integer> ihm=new LinkedHashMap<>();
    ihm.put("Kobe", 20);
    ihm.put("KG",21);
    ihm.put("PP",22);
    ihm.put("Allen",23);
    System.out.println(ihm);
  }

}

推荐阅读