Q. What does this code display?
Code:
int arr[] = new int [9]; System.out.print(arr);
β
Correct Answer: (D)
Garbage value
Explanation: “arr” points to an array of integers. System.out.print(arr);
will display the garbage value. This is not the same as displaying arr[0].
Garbage value designates the unused values available in memory when it is declared.