Fastest way to recreate the ArrayList in a for loop

前端 未结 4 710
野性不改
野性不改 2020-11-29 13:24

In Java, using the following function for a huge matrix X to print its column-distinct elements:

// create the list of distinct values
List va         


        
4条回答
  •  清酒与你
    2020-11-29 14:08

    You can use ArrayList.clear(); this keep address ArrayList in memory, without garbage collector effect on this address.

提交回复
热议问题