list.clear()與list = null 區別

一 . list.clear()底層源碼實現 在使用list 結合的時候習慣了 list=null ;在建立這樣的方式,可是發現使用list的clear 方法很不錯,尤爲是有大量循環的時候java 一、list 接口  的ArrayList 類的clear() 方法源碼 以下:node /**       * Removes all of the elements from this list.
相關文章
相關標籤/搜索