• List遍历时,因为null报错


    List中对象有顺序的保存.
    如果删除对象时使用的是delete,则会出现遍历List对象时发生遍历出null的情况.
    解决办法:
    1.在删除对象时,使用list.remove(int i)方法.
    2.自己使用list.remove(null)来清除对象为null的内容.cattom:该方法经查API只可删除首个元素.无法清空list中所有的null.
    对于list中出现的null清空,可以采取以下方法:
    1.判断值是否为null,为空则继续循环list
    2.将list放入set中,再重新复制回给list.该方法,应注意set中不可存重复的值的问题.


    ---------------
    提交审批时,今天居然提交了target下的内容(本机编译的文件.真是无语啊)
    cattom:问题是如何才能把target下的文件提交到cvs?
  • 相关阅读:
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    How to build and run ARM Linux on QEMU from scratch
    How to debug Android Native Application with eclipse
  • 原文地址:https://www.cnblogs.com/redcoatjk/p/3562388.html
Copyright © 2020-2023  润新知