How many objects are eligible for garbage collection immediately before the end of the main() method?
class Test {
public static void main(String[] args) {
String[] stringArray = new String[1];
int[] intArray = new int[1];
stringArray = null;
intArray = null;
}
}
The answer of the question says "stringArray and intArray eligible for garbage collection" but there is "args" array should be eligible for garbage collection. The answer should be "stringArray, intArray and args" but I am not sure.
Is it args param eligible for garbage collection and can be count in the list?