要释放Array对象,只需为其指定null:
Array myArray = new Array(Types::Integer);
;
myArray = null; //remove reference to Array so it will be garbage collected
Run Code Online (Sandbox Code Playgroud)
要重置数组类型的所有元素,请为元素0赋值:
int myArray[10];
;
myArray[0]=0; //reset all elements of the array to their default value
Run Code Online (Sandbox Code Playgroud)