Analyze the following code:
public class Test {
public static void main(String[] args) {
int[] x = {1, 2, 3, 4};
int[] y = x;
x = new int[2];
for (int i = 0; i < y.length; i++)
System.out.print(y[i] + " ");
}
}
a. The program displays 1 2 3 4
b. The program displays 0 0
c. The program displays 0 0 3 4
d. The program displays 0 0 0 0
a. The program displays 1 2 3 4
Computer Science & Information Technology
You might also like to view...
Computer systems always include ________ devices for permanent storage of instructions and data
A) kernel memory B) flash memory C) volatile storage D) nonvolatile storage
Computer Science & Information Technology
Rows and columns can be inserted and deleted in control layout
Indicate whether the statement is true or false
Computer Science & Information Technology