阅读背景:

将新数组分配给现有数组以在Java中“清除”数组是不好的做法?

来源:互联网 

So I'm currently working on a program that needs to be able to deal with a large amount of data stored in arrays and it needs a method to clear out everything in the array. For the below example, would this be a bad thing to do memory wise? I know the garbage collector would eventually clean it up for you but is there a reason why another method (e.g. a for loop and setting each value within to null) might be better than this?So I'm currently working on a program that need




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: