public class map默认值 {
    public static void main(String[] args) {
        Map<String, String> resultMap = new HashMap(16);
        if (resultMap.isEmpty()) {
            System.out.println("map默认是空");
        }
        if (resultMap != null) {
            System.out.println("map默认不是null");
        }
        if (resultMap.get("message") == null) {
            System.out.println("map.get()参数不存在,是null");
        }
    }
}

输出结果为:

map默认是空
map默认不是null
map.get()参数不存在,是null

相关文章:

  • 2021-12-13
  • 2021-11-29
  • 2022-12-23
  • 2021-10-15
  • 2021-12-07
  • 2021-11-17
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2021-10-09
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案