list.clear()与list = null 区别

一 . list.clear()底层源码实现 在使用list 结合的时候习惯了 list=null ;在建立这样的方式,可是发现使用list的clear 方法很不错,尤为是有大量循环的时候java 一、list 接口  的ArrayList 类的clear() 方法源码 以下:node /**       * Removes all of the elements from this list.
相关文章
相关标签/搜索