Map 属于键-值对应的数据结构,内部基于二叉树实现(也有可能是 Hash),接口下属三个具体实现:

    • HashMap
    • TreeMap,内部有序排列
    • LinkedHashMap,内部顺序和插入顺序一致 ```java import java.util.HashMap;

    public class Main { public static void main(String []args) { HashMap d = new HashMap<>(); //插入键值对 d.put(“adc”, “下路”); d.put(“中单”, “中路”); d.put(“打野”, “野区”); d.put(“辅助”, “下路”); //查询 System.out.println(d.get(“adc”));//下路 System.out.println(d.get(“打野”));//野区 System.out.println(d.get(“上单”));//null //修改 d.put(“adc”, “上路”); System.out.println(d.get(“adc”));//上路 //查询大小 System.out.println(d.size());//4 //清空 d.clear(); //判断是否为空 System.out.println(d.isEmpty());//true } } ```