方法一、list.removeAll(Collections.singleton(null));

 

      方法二、List nullList = new ArrayList();
                 nullList.add(null);
                 list.removeAll(nullList);

 

   方法三、

         Iterator it = list.iterator();
        while (it.hasNext()) {
       if (it.next() == null) {
        it.remove();
    }
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2021-12-14
  • 2021-09-28
  • 2022-12-23
  • 2021-12-26
  • 2021-12-02
相关资源
相似解决方案