First, a Java object will only collect garbage if it is inaccessible (and it may have other references than your array). Then the GC runs at an almost unpredictable time (therefore, memory can be freed much later).
Clearing the elements of an array will not release the entire array, but may free each element (provided that it becomes inaccessible).
setting the variable to null may result in the release of the array (and, of course, all elements).
But for such a small program, perhaps the GC never happens.
Read at least the GC on wikipedia and possibly the GC Handbook
Note that the property of an object is a whole program property (in fact, the whole property of the process: the significance of the values ββis relevant in a specific implementation, and not in the source code). In other words, you could do Options = null; and still have an object in Options[24] to achieve another link path.
source share