Java面试-map集合,map的键可以为空

package com.picchealth.hmbms.utils.export;

import java.util.HashMap;

/**
 * Created by zyq on 2020/7/31.
 */
public class HashMapTest {
    public static void main(String[] args) {
        HashMap hm=new HashMap();
        hm.put(null,"q");
        Object o = hm.get(null);
        System.out.println("========="+o.toString());
    }
}

程序运行结果:

=========q

posted on 2020-07-31 15:28  ~码铃薯~  阅读(690)  评论(0编辑  收藏  举报

导航